How to get the access token from Google Sign-In Javascript SDK? -


i have simple single-page javascript webapp uses "google sign-in websites": https://developers.google.com/identity/sign-in/web/sign-in

how can access token user? need verifiable assertion of user's identity on server. don't want offline access; want know when web client sends ajax request server, can trust identity of logged-in user.

for verification purposes better use id_token part of auth response, , can retrieved @ point this:

gapi.auth2.getauthinstance().currentuser.get().getauthresponse().id_token 

the google api client libraries offer functions verify id_token , give associated user information on server side: https://developers.google.com/api-client-library/


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -