Hello everyone, I hope you are well!
I would like to be able to retrieve a user’s information after registration and redirect from Auth0 to save his information on my DB.
At the moment, after the user’s registration I have a redirection to my application with a “code” and “state” but I can’t find a way to get his UserId in order to retrieve the user’s information myself.
Is there a way to solve to get the user information after his registration with Auth0?
Thanks a lot!
Hi Benjamin,
I hope you are doing well too!
In the Authorization Code flow, you can use the code you receive from Auth0 to get an ID Token and an Access Token.
To get user profile information, you can decode the ID Token you receive using a token verification library:
Example ID Token
Alternatively, you can use the Access Token to get profile information about the user using the /userinfo endpoint.
Here is a guide on how to add auth to your application using authorization code flow: Add Login Using the Authorization Code Flow
The guide describes how to exchange the code for the ID Token and Access Token.
Let me know if you have any follow up questions!
Stephanie
2 Likes
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.