Closed geniallink closed 1 year ago
Hi @geniallink, thanks for raising this.
A custom claim is indeed the way to go for this. Credentials.user.customClaims
is a map, so it should contain the custom claim, provided it was set using an Action/Rule.
Please check https://auth0.com/blog/adding-custom-claims-to-id-token-with-auth0-actions/ to learn more about adding custom claims to the ID token.
Closing, as I believe the above answers your question. Please feel free to ping if you'd prefer to reopen.
Checklist
Describe the problem you'd like to have solved
I'd like to have the created_at column to check if the user loggin in is a newly created user or not (I don't want control that in app side, because user can access app across other platforms).
I tried using custom claims but returns a sid in Credentials.user.customClaims, how can I use this sid to get the custom claims?
Describe the ideal solution
Return the created_at field in class Credentials.user
Alternatives and current workarounds
As a workaround I am doing a get request in the URL https://my-app.us.auth0.com/api/v2/users/[userId] using a management api key making, which is far from ideal to keep this key in the app (in my case, a mobile app).
Additional context
No response