Auth0 Home Blog Docs

Why did Email address recently disappear from access token for native client

client
access-token
email
uwp
native

#1

We are fairly new still to Auth0. We’ve had several environments setup with multiple API’s and a web SPA client. We have recently setup a native UWP Windows app which uses Lock to authenticate in. It took us a while to get things configured and working properly at first for the new client, but then it was. We aren’t using this client regularly yet, so we don’t know exactly when. But sometime in the last 1-2 weeks, something changed out from under us and our access token no longer contains an email address. We had been manually injecting it with a rule and web hook (I’m honestly not sure which one was being used in this context, perhaps both?). Does anyone know why it might have disappeared and how to get it back?

All of this is because our API was coded against another authentication mechanism before which expected the email address to be included and we haven’t taken the time to make the API use a proper Auth0 API call to grab the email from the original access token.

Please help!


#2

Inevitable. As soon as you break down and actually formalize asking a question, you figure it out for yourself. I was able to solve the behavior by adding a full URL schema for the email address in the access token through a rule … the .email property no longer worked.

context.accessToken.email = user.email;
context.accessToken'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress'] = user.email;

That first line had been working, but no longer does. The latter line is now required.


#3