Manuelarte
Manuelarte

Reputation: 1810

Add app metadata and user metadata in token auth0

I'd like to add the user metadata and app metadata in the claims of the token when I ask for the jwt to auth0.

I am not using lock.js, I'm using WebAuth. I added this in the scope attribute when doing the https request

Scope: openId profile email user_metadata app_metadata

But I don't get those fields.

Upvotes: 3

Views: 2475

Answers (1)

Siva Kandaraj
Siva Kandaraj

Reputation: 844

You dont get custom attributes anymore with /userinfo endpoint.

This will only work with legacy tenants and all the new tenants adheres OpenId connect defined scopes.

You can still write rules as explained here: https://auth0.com/docs/api-auth/tutorials/adoption/scope-custom-claims#custom-claims

This way, the ID token will have custom attribues, which you can read from the token about the extra attributes you want.

I hope this makes sense.

Upvotes: 3

Related Questions