# Auth0 token not RS256

**URL:** <https://community.auth0.com/t/auth0-token-not-rs256/85384>\
**Category:** Get Help\
**Tags:** auth0, login\
**Created:** [June 20, 2022, 5:17am UTC](https://community.auth0.com/t/auth0-token-not-rs256/85384 "2022-06-20T05:17:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SreekarMouli98](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sreekarmouli98/32/38038_2.png) [@SreekarMouli98](https://community.auth0.com/u/SreekarMouli98)\
**Post date:** [June 20, 2022, 5:17am UTC](https://community.auth0.com/t/auth0-token-not-rs256/85384/1 "2022-06-20T05:17:19Z")

</div>

I am working on a project which uses Django backend and ReactJS frontend. I had initially build my own authentication system but now, I want to replace that with auth0. I have followed the following docs to integrate auth0:

ReactJS: [Auth0 React SDK Quickstarts: Add Login to your React App](https://auth0.com/docs/quickstart/spa/react/interactive)

Django: [Auth0 Django API SDK Quickstarts: Authorization](https://auth0.com/docs/quickstart/backend/django/01-authorization)

* * *

In the frontend, after user logins, I am trying to get the access token by using the `getAccessTokenSilently()` function. I have observed that the obtained token has empty payload and the “alg” is “dir” instead of “RS256”. How can I resolve this?

**ReactJS Code:**

```plaintext
function App() {
  const {
    loginWithRedirect,
    user,
    isAuthenticated,
    isLoading,
    getAccessTokenSilently,
  } = useAuth0();

  useEffect(async () => {
    if (isAuthenticated && !isEmpty(user)) {
      let token = await getAccessTokenSilently({});
      console.log('token', token);
    }
  }, [isAuthenticated, user]);

  if (!isLoading && !isAuthenticated) {
    return loginWithRedirect();
  }

  if (isLoading || !apolloClient) {
    return (
      <>
        <p>Loading...</p>
      </>
    );
  }

  return (
    <>
      <p>APP</p>
    </>
  );
}

function AppWrapper() {
  return (
    <Provider store={store}>
      <BrowserRouter>
        <Auth0Provider
          domain={process.env.AUTH0_DOMAIN}
          clientId={process.env.AUTH0_CLIENT_ID}
          redirectUri={window.location.origin}
        >
          <Alerts />
          <App />
        </Auth0Provider>
      </BrowserRouter>
    </Provider>
  );
}

ReactDOM.render(<AppWrapper />, document.getElementById("root"));

```

**Sample JWT:**

```auto
eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9ldmVyeXRoaW5nLWFwcC1kZXYudXMuYXV0aDAuY29tLyJ9..6M2OeYCgUNEDULy4.8AfbjO1U0bDFucPF0AZYoZ0v8c1Qv5SNfOIuiPk4x-8Q3o0ib5SRNwukMIbrXIdG8Va_HCRTMg5cJET0jFk2tD2eGlGh2mp7uiGoWP1w_VZUKPxeW3ZZxJie8nxm1447TWXZ7C0WemLllD5maZRX96aOh3dcAUF-Ue42whZI9jXd0khtfY9cWssp7w-cB3CNCCEXDLeorgkp8k-jIO1qUWVC5bIGmKryy_zZf6TbTAtb-dO10v04WT0g-r70Ha3UIeiezCY2fY77dyAr7f8EhXRHQA5UL871VwpgWB1dzUGCW29gwaZNnJEBiF3y-voBhMCvOxXnkDBYNNCNrLs.t4LCOCfMcHdLrfFFNYP8uQ

```

**Screenshot from [jwt.io](http://jwt.io)**

 ![Screenshot 2022-06-20 at 10.45.44 AM](https://global.discourse-cdn.com/auth0/original/3X/0/f/0fd772a2a6cfb6a861fc74a77b5023fe0d7c2c0e.png)

**Screenshot of Auth0 application settings:**

 ![Screenshot 2022-06-13 at 10.16.21 AM](https://global.discourse-cdn.com/auth0/original/3X/2/9/299f7cff2a19201cc1fe8a8e8ad6151b8dddd7b1.png)

* * *

I intend to use this access token when making backend API calls. As per the `jwt_decode_token` code snippet, I should be getting `kid` in the jwt payload which is not happening.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 22, 2022, 4:30pm UTC](https://community.auth0.com/t/auth0-token-not-rs256/85384/3 "2022-06-22T16:30:44Z")

</div>

Hi @SreekarMouli98,

Welcome to the Auth0 Community!

It looks like you are seeing an encrypted token instead of a JWT. This because you are not passing an audience parameter to auth0 with the request to authorize.

This FAQ explains the difference between the tokens and links to resources explaining how to get a JWT token.

[https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028](https://community.auth0.com/t/why-is-my-access-token-not-a-jwt-opaque-token/31028)

---

<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:** [December 21, 2022, 4:04pm UTC](https://community.auth0.com/t/auth0-token-not-rs256/85384/4 "2022-12-21T16:04:36Z")

</div>


