Disable automatic authentication for social login on Google+

I am looking for a way to avoid automatic user authentication in my web application when it refreshes the page.

For example, a user connects to my web application using his Google+ account and uses this application for some time. Later, when he returns, I want the application to ask him to press the login button again, instead of automatically recognizing him as already passed the test.

Using Facebook, I can set the status property to false when I call FB.init() so that it does not automatically authenticate the user during initialization.

Is this possible using the Google+ SDK?

Thanks in advance!

+4
source share
1 answer

I just found how to do this if someone wants to find out:

 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 you to control when a user is requested to obtain consent. When it is installed automatically, the user sees the OAuth consent dialog if he has not authorized your application. For the forced user, the OAuth consent dialog is displayed to the user every time they press the login button. "

https://developers.google.com/+/web/signin/#sign-in_button_attributes

+5
source

Source: https://habr.com/ru/post/1499399/


All Articles