Skip to content
Discussion options

You must be logged in to vote

After countless hours of research, reading documents and trying things,

I got an acceptable solution.

At Auth0.com there is Auth Pipeline -> Rules.

Added this rule:

function addAttributes(user, context, callback) {
  context.idToken['https://example.com/username'] = user.username;
  callback(null, user, context);
}

(If I only used username attribute it did not work).
https://auth0.com/docs/configure/apis/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token
https://auth0.com/docs/security/tokens/json-web-tokens/create-namespaced-custom-claims

In NextAuth I tried to override default behavior and log the profile hoping to see something new there.

    providers: [
      Auth…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ipko1996
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ipko1996
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
question Ask how to do something or how something works
2 participants
Converted from issue

This discussion was converted from issue #2920 on October 08, 2021 12:23.