# Access Token after getting auth code

**URL:** <https://community.auth0.com/t/access-token-after-getting-auth-code/19627>\
**Category:** Get Help\
**Created:** [January 4, 2019, 4:29pm UTC](https://community.auth0.com/t/access-token-after-getting-auth-code/19627 "2019-01-04T16:29:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kandarprakeshbhai](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kandarprakeshbhai/32/10249_2.png) [@kandarprakeshbhai](https://community.auth0.com/u/kandarprakeshbhai)\
**Post date:** [January 4, 2019, 4:29pm UTC](https://community.auth0.com/t/access-token-after-getting-auth-code/19627/1 "2019-01-04T16:29:57Z")

</div>

I am getting auth code by hitting below URL.

```auto
https://YOUR_AUTH0_DOMAIN/authorize?
    audience=YOUR_API_AUDIENCE&
    scope=YOUR_SCOPE&
    response_type=code&
    client_id=YOUR_CLIENT_ID&
    redirect_uri=https://YOUR_APP/callback&
    state=YOUR_OPAQUE_VALUE

```

When I try to get access token using code that I got in previous step, it says access denied. I am using below URL to get access token.

```auto
options = { method: 'POST',
  url: 'https://YOUR_AUTH0_DOMAIN/oauth/token',
  headers: { 'content-type': 'application/json' },
  body: 
   { grant_type: 'authorization_code',
     client_id: 'YOUR_CLIENT_ID',
     client_secret: 'YOUR_CLIENT_SECRET',
     code: 'YOUR_AUTHORIZATION_CODE',
     redirect_uri: 'https://YOUR_APP/callback' },
  json: true };

```

Any help?

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [January 5, 2019, 3:20pm UTC](https://community.auth0.com/t/access-token-after-getting-auth-code/19627/2 "2019-01-05T15:20:52Z")

</div>

Is this a server-side request to the `/oauth/token` endpoint? Can you post the exact response that you get, including the status code?

Also, double check all the parameters to make sure they are correct.
