# Get access\_token but cant use to get user information

**URL:** <https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086>\
**Category:** Get Help\
**Tags:** error, access-token, auth0\
**Created:** [June 8, 2021, 11:13am UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086 "2021-06-08T11:13:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![manhhoang3151996](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manhhoang3151996/32/29811_2.png) [@manhhoang3151996](https://community.auth0.com/u/manhhoang3151996)\
**Post date:** [June 8, 2021, 11:13am UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086/1 "2021-06-08T11:13:28Z")

</div>

I followed this tutorial to get access\_token [Call Your API Using the Authorization Code Flow](https://auth0.com/docs/flows/call-your-api-using-the-authorization-code-flow#request-tokens) ( i am using laravel to build API)  
But when i dump the response. I got something like this

 ![image](https://global.discourse-cdn.com/auth0/original/3X/d/5/d5a93f8e8840fd1d6689b8cafbe188604e9d159a.png)

As you can see, the access\_token is really shot, i think it wasn’t encrypted. And i tried to use that token to get user information and it failed.

After this, i cloned repo react in quick start guild and used the same config. And response is different

 ![image](https://global.discourse-cdn.com/auth0/original/3X/9/8/9861a0c07b460e0e796d226a8977256a7b4bb53c.png). Not only access\_token was encrypted but expires time has different value too. With this access\_token, i can use to get user information.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [June 8, 2021, 11:46am UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086/3 "2021-06-08T11:46:50Z")

</div>

Hi @manhhoang3151996,

The user’s information can be found in the ID Token. You can decode the token at [jwt.io](http://jwt.io)

The Access Token will be returned as either a JWT or an opaque token depending on the `audience`. If no audience is configured in the client application, then the `audience` is your Auth0 tenant’s `/userinfo` endpoint (`https://{your-auth0-domain}/userinfo`), and the token is opaque.

To get a JWT Access Token that can be decoded, you can pass an [API identifier](https://auth0.com/docs/get-started/set-up-apis) as the audience:

```auto
ReactDOM.render(
  <Auth0Provider
    domain={config.domain}
    clientId={config.clientId}
    redirectUri={window.location.origin}
    audience={config.audience}
    onRedirectCallback={onRedirectCallback}
  >
    <App />
  </Auth0Provider>,
  document.getElementById("root")
);

```

> **[Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens)**
>
> Describes how access tokens are used in token-based authentication to allow an application to access an API after a user successfully authenticates and authorizes access.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [June 8, 2021, 1:02pm UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086/5 "2021-06-08T13:02:37Z")

</div>

Hi @manhhoang3151996,

Would you mind sending an example request (be sure to take out any sensitive info such as a client ID or your domain)? for example:

```auto
https://YOUR_DOMAIN/authorize?
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    scope=SCOPE&
    audience=API_AUDIENCE& // <-- This determines whether a JWT will be returned for the Access Token
    state=STATE

```

In the request, if you list the `audience` as an API identifier of a registered API in your tenant, you should receive a JWT for the Access Token.

---

<div class="post-metadata">

**Author:** ![manhhoang3151996](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/manhhoang3151996/32/29811_2.png) [@manhhoang3151996](https://community.auth0.com/u/manhhoang3151996)\
**Post date:** [June 8, 2021, 1:04pm UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086/6 "2021-06-08T13:04:38Z")

</div>

oh, i read too fast so i skip \*\* The Access Token will be returned as either a JWT or an opaque token depending on the `audience`\*\* part. Thank you, i did it 😃

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [June 23, 2021, 1:04pm UTC](https://community.auth0.com/t/get-access-token-but-cant-use-to-get-user-information/64086/7 "2021-06-23T13:04:46Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
