Get email on Elixir/Phoenix

Today I followed your tutorial to setup authentication on an Elixir/Phoenix web app (Elixir & Phoenix Tutorial: Build an Authenticated App). It was great because as a new developer in Elixir it’s difficult to setup your own authentication with no experience. Now I can focus on making the easier features. I would like to get the email upon login and register an account in the database. How would I approach this? Does Auth0 share the account email?

When authenticating through Auth0 any user profile information available can be returned or made accessible to the client application either through standard OpenID Connect claims or custom ones.

In this case, email is a user profile field covered by OIDC standard claims so obtaining the email is mostly independent of technology stack. In particular you would need to ensure that the client application sends a scope parameter to Auth0 that contains at least openid email. This would mean that if an email is available for that user then any ID token issued as part of that authentication event would contain an email claim with the address.