markd
February 14, 2019, 3:10pm
2
Hello @cdodge ,
For attributes that are not part of the standard scopes , you can add custom claims to your token using rules . You can see an example at the link below:
Hi @mike.griffin ,
There are probably better ways to code this, but here’s an example rule that adds user.username to the idToken:
function (user, context, callback) {
user.username = user.username || "";
context.idToken['https://sso.yourdomain.com/username'] = user.username;
callback(null, user, context);
}
The namespace https://sso.yourdomain.com/ can be whatever you want (but not an Auth0 domain). Just needs to be a unique string.
Or if, say, you manage your own username in app_meta…
1 Like