Hi, I am student and was just creating a small Angular application. I am implemented auth0 universal login for my app. I need access to the email address of the user that just logged in. How would I retrieve this information? I have looked online and have seen mention of custom claims and including the email address in the token. But even after log in I do not see a token in the local storage when debugging with Chrome. Any help would be appreciated.
Welcome to Community,
Just to make things clear, Are you trying to get user email in access token after user login successfully?
Tokens aren’t stored in local storage, it’s not recommended. They’re just stored in memory by the SDK.
See Token Storage
Did you try the Angular quickstart?
https://auth0.com/docs/quickstart/spa/angular2
I have looked online and have seen mention of custom claims and including the email address in the token.
The standard claims requested in the tutorials are usually openid profile email
, make sure you request those, esp. the email
claim. There’s no need for custom claims.
@rashid779939 Regarding
Are you trying to get user email in access token after user login successfully?
I think it should be the ID token, unless 1. he added a custom claim for the access token, 2. he meant to parse the access token in a backend of his; access tokens aren’t meant to be read by the client.