0
votes

I am configuring auth0 to be used with React. I was able to follow this guide and get it working:

https://auth0.com/docs/quickstart/spa/react#configure-auth0

However I am not able to figure out how I get the access code. I would like to take that and store it in my database along with other information from the user/ personal information as well as store it in a redux store for use with my backend database to link the user to the data.

When a user logs in, Auth0 returns three items:

access_token,
id_token,
expires_in

You can use these items in your application to set up and manage authentication.

Would appreciate any pointers with how to get the access and id tokens using the hooks format shown above.

1
I'm also looking through the documentation to implement Auth0 with hooks. The following link may be helpful: auth0.com/docs/quickstart/spa/react They recently updated the documentation & github repo. - Daniel Moon

1 Answers

1
votes

It sounds like you might be looking for the credentials-exchange extensibility point hook as it allows you to change the scopes and add custom claims to the Access Tokens issued by the Auth0 API's POST /oauth/token endpoint during runtime. This would be beneficial to feed off those custom claims and store as you previously mentioned. Hooks are very powerful when setup correctly so be sure to let us know if you have any questions!