How to revoke Oauth token by using Google's Javascript APIs? -
in (client-side angularjs) web application use google api's oauth let user sign-in
gapi.auth.authorize({ client_id: clientid, scope: scopes, immediate: true }, handleauthresult);
now want let user signout well.
i found can using http request explained in:
however since i'm using javascript apis sign-in, use javascript logout (i.e. revoking access token).
is possible? if yes, how?
edit : precise goal not use http request via jquery more alike login, example :
gapi.auth.signout (..
the google gapi library doesn't have such method. if you're jquery averse, it's not difficult replace $.ajax xmlhttprequest.
make sure understand difference between "signing out" (of google account) , revoking access token. not same thing.
on sessions, typical sequence is:-
1/ check session object see if holding user object.
1a/ if yes, user "logged in"
1b/ if no, use oauth discover user is, him in user database, , store user object in session
to logout, remove user object session.
there many variations , alternatives technique user/session management in oauth world. 1 approach.
Comments
Post a Comment