# getTokenSilently

**URL:** <https://community.auth0.com/t/gettokensilently/31964>\
**Category:** Get Help\
**Tags:** access-token\
**Created:** [October 7, 2019, 8:49pm UTC](https://community.auth0.com/t/gettokensilently/31964 "2019-10-07T20:49:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmpmcmanus](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmpmcmanus/32/13395_2.png) [@jmpmcmanus](https://community.auth0.com/u/jmpmcmanus)\
**Post date:** [October 7, 2019, 8:49pm UTC](https://community.auth0.com/t/gettokensilently/31964/1 "2019-10-07T20:49:01Z")

</div>

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

I’m trying to replicate the Tutorial:

> **[Create Modern Applications with Django and Vue.js - Learn Here](https://auth0.com/blog/building-modern-applications-with-django-and-vuejs/)**
>
> Learn ow to create a full-stack application with Django, Django REST framework, and Vue.js. Then, learn how to secure your REST API and t...

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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [October 8, 2019, 8:41am UTC](https://community.auth0.com/t/gettokensilently/31964/3 "2019-10-08T08:41:22Z")

</div>

Hey there @jmpmcmanus!

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

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 19, 2020, 12:42pm UTC](https://community.auth0.com/t/gettokensilently/31964/4 "2020-03-19T12:42:49Z")

</div>

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:

> **[Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk)**
>
> Auth0 SDK for single page applications using Authorization Code Grant Flow with PKCE.

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](https://manage.auth0.com/#/apis). Additionally, user consent [cannot be skipped on ‘localhost’](https://auth0.com/docs/api-auth/user-consent#skipping-consent-for-first-party-applications).

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.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 25, 2020, 3:34pm UTC](https://community.auth0.com/t/gettokensilently/31964/5 "2020-03-25T15:34:47Z")

</div>


