Auth0 Home Blog Docs

Get user info with auth0client from spa SDK

Hello!

im having troubles to get the user objetct in the SDK for SPA, i want to add a username attribute to the object that is send to frontend from a custom database connection, the username is stored there, and i tried adding it to the callback on the login script, adding a rule to add the attribute, adding it at the metadata, but i keep recieving the same object all the time without the username attribute, even i can see the username attribute on the user dashboard, but i just cant handle it to my app.

Hi @lalita960701,

Welcome to the Auth0 Community Forum!

If you need the username in the token, you can always add it as a custom claim. Described here:

You can also add the metadata to the token as a custom claim (this is a common approach for any extra info you need in the token). This prevents you from having to make numerous requests for authentication.

Hope this helps!

Thanks,
Dan

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.