How to get the "id_token" from access_token?

Hi,
I want to get the “id_token” from passing the access_token. How can i do that?
One more in laravel(6.2) how can i decode the id_token to get the user info?
plz help i am stuck.

1 Like

Hey @haroon.momin,

What are you trying to accomplish? If you need to retrieve the user’s profile, you can call our /userinfo endpoint with an Access Token as a parameter.

Regarding how to decode the id_token, you can take a look at https://auth0.com/docs/libraries/auth0-php/validating-jwts-with-auth0-php or just visit https://jwt.io/ where you have a lot of libraries and information about the topic.

1 Like

@Ale,
I am accessing the PHP-API in the Front-end. For every request, i have to pass the “access_token” which is already i am doing, But i am unable to get the User’s information bcoz i am having only “access_token” as a param.
So, i want the user information. As you said if i hit the endpoint of “/userinfo” it is having the rate_limit barrier i can’t hit more than 10 requests.
So, i want userinfo from the “access_token” OR from passing the access_token how can i get the “id_token” and the lib name for decoding it?
How can i accomplish this.

The only information about the user that an Access Token will have is the user_id.

The only way to get the user’s profile from an Access Token is to leverage our /userinfo endpoint

All of the above is documented on https://auth0.com/docs/tokens/access-tokens#sample-access-token

To get an ID Token, you must request it when users authenticate: Get ID Tokens

1 Like