# Postman OAuth Code+PKCE

**URL:** <https://community.auth0.com/t/postman-oauth-code-pkce/105562>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [April 26, 2023, 1:32pm UTC](https://community.auth0.com/t/postman-oauth-code-pkce/105562 "2023-04-26T13:32:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alevinger](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alevinger/32/33806_2.png) [@alevinger](https://community.auth0.com/u/alevinger)\
**Post date:** [April 26, 2023, 1:32pm UTC](https://community.auth0.com/t/postman-oauth-code-pkce/105562/1 "2023-04-26T13:32:23Z")

</div>

Hi,

I’ve successfully used Postman to update access tokens in the past, but it’s not working for me now, though I haven’t changed any of the settings. I click “Get New Access Token” in postman and am redirected to the auth0 login page. It appears to be successful, but then I’m redirected to Postman which has the message: Authentication Failed. Couldn’t complete Authentication. Check the postman console for more details."

The postman console shows a 401 unauthorized response.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/1/3/136bfa5b9724e891c5e68a4fceb5a25ea1171cdb.png)

Auth0 logs are showing a successful login, but then a failed exchange.

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

Any suggestions for how to proceed?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 26, 2023, 11:47pm UTC](https://community.auth0.com/t/postman-oauth-code-pkce/105562/3 "2023-04-26T23:47:46Z")

</div>

Hi @alevinger,

Thanks for reaching out to the Auth0 Community!

I understand that you experience the `401 Unauthorize` error.

Firstly, have you gotten a chance to review our [Add Login Using the Authorization Code Flow with PKCE](https://auth0.com/docs/get-started/authentication-and-authorization-flow/add-login-using-the-authorization-code-flow-with-pkce) documentation?

And could you please clarify if you were successful with logging in when calling the `/authorize` endpoint?

It would look something like the following:

```auto
https://{yourDomain}/authorize?
    response_type=code&
    code_challenge={codeChallenge}&
    code_challenge_method=S256&
    client_id={yourClientId}&
    redirect_uri={yourCallbackUrl}&
    scope={scope}&
    state={state}

```

After successfully logging in, you should get a **code** which you can use to exchange for an Access Token by calling the `/oauth/token` endpoint.

Please note that you will need to call the `/authorize` on a browser and then you can use Postman to call the `/oauth/token` endpoint. This is because the `/authorize` endpoint requires user interaction, specifically, it requires the user to log in.

Once that is complete, you should get an Access Token for your application.

Please let me know how this goes for you.

Thanks,  
Rueben

---

<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:** [May 10, 2023, 11:48pm UTC](https://community.auth0.com/t/postman-oauth-code-pkce/105562/4 "2023-05-10T23:48:33Z")

</div>

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