Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is id_token google oauth

I just got the following result when I tried to do oauth2 to googleapi. Only one thing: I couldn't find what is id_token used for in documentation.

{   "access_token": "xxxx",   "token_type": "Bearer",   "expires_in": 3600,   "id_token": "veryverylongstring",   "refresh_token": "abcdefg" } 
like image 364
kitokid Avatar asked Dec 14 '12 08:12

kitokid


People also ask

What is the id_token used for?

ID tokens are issued by the authorization server and contain claims that carry information about the user. They can be sent alongside or instead of an access token. Information in ID Tokens allows the client to verify that a user is who they claim to be.

What is the difference between Access_token and id_token?

Access tokens are what the OAuth client uses to make requests to an API. The access token is meant to be read and validated by the API. An ID token contains information about what happened when a user authenticated, and is intended to be read by the OAuth client.

What is Google OAuth credentials?

OAuth client ID – Use this credential to authenticate as an end user and access their data. Requires your app to request and receive consent from the user.


1 Answers

id_token is a JSON Web Token (JWT). If you decode it, you'll see it contains multiple assertions, including the ID of the user. See this answer for more details.

like image 192
vlatko Avatar answered Sep 24 '22 03:09

vlatko