getTokenSilently

Does getTokenSilently() in @auth0/auth0-spa-js produce the same token as accessToken in auth0-js?

I’m trying to replicate the Tutorial:

which uses auth0-js, but I’m using @auth0/auth0-spa-js. In that tutorial they build an SPA with auth0 authentication, that can also authenticate a backend Django Rest Framework app, using jwt and the token from the SPA. So far I have only gotten status code 401 when using the token obtained from getTokenSilently.

Thanks
Jim

Hey there @jmpmcmanus!

Not sure exactly about this one but let me dig in and get back to you with the info I find!

Hey there!

Terribly sorry for the delay in response but sometimes the number of incoming questions we get is too big for a team consisting of three people.

If you haven’t got past the struggle you described I checked our docs:

and it doesn’t mention anything about the access token from getTokenSilently being anyhow different.

It is said that when using getTokenSilently requires you to have Allow Skipping User Consent enabled in your API Settings in the Dashboard. Additionally, user consent cannot be skipped on ‘localhost’.

The 401 status code that you receives might be due to the thing I mentioned above which is not skipping user consent that is blocking that.