I'm looking for a way to avoid the user to be automatically authenticated in my web app when he refreshes a page.
For example, the user connects to my web app using his Google+ account and uses the app for a while. Later, when he comes back, I want the app to ask him to click the login button again, instead of automatically recognizing him as already authenticated.
With Facebook, I'm able to set the status
property to false
when calling FB.init()
, so that it will not automatically authenticate the user upon initialization.
Is this possible with the Google+ SDK?
Thanks in advance!
I Just found how to do it, in case anyone wants to know:
gapi.signin.render('botaoLoginUsuarioGoogle', {
'callback': googlePlusSigninCallback,
'clientid': '-----------------------------',
'cookiepolicy': 'single_host_origin',
'requestvisibleactions': 'http://schemas.google.com/AddActivity',
'scope': 'https://www.googleapis.com/auth/userinfo.email',
'approvalprompt': "force"
});
According to the documentation, the approvalprompt
attribute "Allows control over when the user is re-prompted for consent. When set to auto, the user only sees the OAuth consent dialog if they have not authorized your application. When set to force, the user is shown the OAuth consent dialog each time that they click the sign-in button."
https://developers.google.com/+/web/signin/#sign-in_button_attributes