authentication - Google Auth2.0 log out -


i'm trying make site user can log in google+ account. of working. them grant access website. can log in , name , user id, , show content specific google account on site.

when else wants log in , try 'log out' of site, google log in still remembers logged in , after logging out instantly runs code log in again. if delete ssid cookie google doesn't this, i'm assuming that's google stores fact logged in x.

is there way when log out make google not instantly log in same account, rather ask e-mail , password of google user?

i feel i'm missing obvious here, can't figure out how deal this.

code use auth , data:

 <button class ="btn btn-primary" id="authorize-button" style="visibility: hidden">log in</button>  <script>    var clientid = '';    var apikey = '';    var scopes = '';     function handleclientload() {      gapi.client.setapikey(apikey);     window.settimeout(checkauth,1);   }    function checkauth() {    //alert("authorize");     gapi.auth.authorize({client_id: clientid, scope: scopes, immediate: true}, handleauthresult);   }     function handleauthresult(authresult) {      //alert("authorized");        //alert(authresult.access_token);     var authorizebutton = document.getelementbyid('authorize-button');     if (authresult && !authresult.error) {       authorizebutton.style.visibility = 'hidden';       makeapicall();     } else {       authorizebutton.style.visibility = '';       authorizebutton.onclick = handleauthclick;     }     var token = document.createelement('h4');     token.appendchild(document.createtextnode(authresult.access_token));     document.getelementbyid('content').appendchild(token);      }    function handleauthclick(event) {     gapi.auth.authorize({client_id: clientid, scope: scopes, immediate: false}, handleauthresult);     return false;   }    var x;   function makeapicall() {    //return;     gapi.client.load('plus', 'v1', function() {       var request = gapi.client.plus.people.get({         'userid': 'me'       });       request.execute(function(resp) {         x = resp.id;         var heading2 = document.createelement('h4');         var heading3 = document.createelement('h4');         heading3.appendchild(document.createtextnode(resp.displayname));         heading2.appendchild(document.createtextnode(resp.id));          document.getelementbyid('content2').appendchild(heading2);         document.getelementbyid('content3').appendchild(heading3);            $.post("token.php", {id: x});          });      });    } 

when make auth call, set approvalprompt force. force consent dialog appear every time. overrides default setting of "auto." can learn more @ https://developers.google.com/+/web/signin/#sign-in_button_attributes.

gapi.auth.authorize({client_id: clientid, scope: scopes, immediate: true, approvalprompt: force}


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -