# Only receiving access token from end point

**URL:** <https://community.auth0.com/t/only-receiving-access-token-from-end-point/86169>\
**Category:** Get Help\
**Created:** [June 29, 2022, 2:40pm UTC](https://community.auth0.com/t/only-receiving-access-token-from-end-point/86169 "2022-06-29T14:40:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mayyar.alatari](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mayyar.alatari/32/33197_2.png) [@mayyar.alatari](https://community.auth0.com/u/mayyar.alatari)\
**Post date:** [June 29, 2022, 2:40pm UTC](https://community.auth0.com/t/only-receiving-access-token-from-end-point/86169/1 "2022-06-29T14:40:37Z")

</div>

Hello,

I am following the guide to retrieving the id, access, and refresh token for a nodejs project. I am utilizing authorization\_code flow, where the user logs in via the default auth0 account login(non-3rd party login).

When I make the request successfully I only receive the users access token, but not the id token.  
I am making the request to the /oauth/token with the authorization code present.

Here is the guide I am following:[Call Your API Using the Authorization Code Flow](https://auth0.com/docs/get-started/authentication-and-authorization-flow/call-your-api-using-the-authorization-code-flow)

Here is my server code:

```auto
const getAuth0Tokens = async(code)=>{
    console.log(`code => here ${code}`)
    var options = {
      method: 'POST',
      url: 'https:// ********.us.auth0.com/oauth/token',
      headers: {'content-type': 'application/x-www-form-urlencoded'},
      data: new URLSearchParams({
          client_id: ' *************clientId**********',
          client_secret: ' *************clientSecret**********',
          audience: 'https://localhost:3000/login.html',
          grant_type: 'authorization_code',
          redirect_uri:"https://localhost:3000/login.html",
         code:`${code}`            
      })
    };

    
    return await axios.request(options).then(function (response) {
        console.log("data from auth0 token call " + JSON.stringify(response.data));
        const {id_token,access_token, refresh_token, token_type, expires_in} = response.data;
        return {id_token, access_token, refresh_token, token_type, expires_in}
    }).catch(function (error) {
      console.error(error);
    });
}

```

Here is the response:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/1/31a5fe551fd5993f3a3fcd98da38e9f4d8fc82c7.jpeg)

The request is returning successfully with 200 status response. For more context I am on the free subscription account tier.

Could the error be due to mu auth0 account configuration? or maybe something else.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [June 29, 2022, 10:56pm UTC](https://community.auth0.com/t/only-receiving-access-token-from-end-point/86169/3 "2022-06-29T22:56:27Z")

</div>

Hello there @mayyar.alatari welcome to the community!

 ![image](https://global.discourse-cdn.com/auth0/original/3X/3/1/31a5fe551fd5993f3a3fcd98da38e9f4d8fc82c7.jpeg)

Looking at this response, there isn’t any scope(s) defined and therefore only an access token will be returned - In order to receive an ID token you will need to include the `openid` scope, and in order to receive a refresh token you will need to include the `offline_access` scope.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 14, 2022, 10:56pm UTC](https://community.auth0.com/t/only-receiving-access-token-from-end-point/86169/4 "2022-07-14T22:56:49Z")

</div>

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