I am trying to integrate React with Auth0 and I am using the functions provided by react-auth0-spa.js.
In this, there is a function loginWithRedirect that redirects a user to Auth0 universal login page if the user hasn’t authenticated before.
Once there is a callback from Auth0, it is handled by another function:
At this point, I want the user profile as well as the access token and id token. How can I do that?
I could see browser making an API call for the token.
Have you looked through our react quickstart? It demonstrates how to get userinfo and an access token. To get the id token you can use the function described here.
If you have trouble let me know and we can walk through it.
I am already aware of getting an access token and id token. Whenever a user logs in with Auth0, there are HTTP calls for /authorize followed by call for oauth/token and in the response of oauth/token, we get access token, id token. I wanted to know if that response is available to us via react-auth0-spa?