# Unable to Obtain OAuth Access Code

**URL:** <https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914>\
**Category:** Help Hub\
**Tags:** oauth\
**Created:** [February 20, 2020, 1:03pm UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914 "2020-02-20T13:03:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danchirillo](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@danchirillo](https://community.postman.com/u/danchirillo)\
**Post date:** [February 20, 2020, 1:03pm UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914/1 "2020-02-20T13:03:51Z")

</div>

Hello -

I created a [git issue](https://github.com/postmanlabs/postman-app-support/issues/8051) for this but there’s been no feedback yet on it so I thought I’d share it here since someone might have some insight.

**Environment**

- Postman Native App Version 7.18.0
- Issue reproduced in macOS Catalina (10.15.3) and Windows 10

**The Issue**  
I’m unable to use Postman to retrieve an OAuth access token. As far as I can tell from the Postman log, Postman is refusing to follow the redirect because it doesn’t match the `registered callback URL`. The only difference that I see is URL encoding of that URL (see **Postman Log** at bottom of post)

**Steps To Reproduce**

1. Request access token using Postman UI (Get New Access Token)

**Expected Behavior**  
Postman directs to Authorization URL and then back to the Postman callback URL with an access code.

When I use a **browser** (not Postman) to request the authorization code by using the following URL:  
[https://datapower.192.168.13.10.nip.io/pd/sandbox/datapower/oauth2/authorize?response\_type=code&client\_id=d0189df3de1e32e9ebea9cd7003ef9ac&scope=scope\_1&redirect\_uri=https%3A%2F%2Fwww.getpostman.com%2Foauth2%2Fcallback](https://datapower.192.168.13.10.nip.io/pd/sandbox/datapower/oauth2/authorize?response_type=code&client_id=d0189df3de1e32e9ebea9cd7003ef9ac&scope=scope_1&redirect_uri=https%3A%2F%2Fwww.getpostman.com%2Foauth2%2Fcallback)

The redirect to the authorization URL works:

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/b/b10ba4434664ac1a1a746d342d8a90f5df95c155.png)

As well as the redirect – after authorization – back to the Postman callback URL with the authorization code (which I can then give to `curl` to get the access code

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/e/9e6b04b66a291598751c6f7559bd8550eb520f7b.png)

**Actual Behavior in Postman**  
There is no redirect to the auth URL. Instead, an error is displayed on the Postman OAuth dialog window (`Failed`)

**Postman Log**

````auto
[23652][1581515931006][main][info]["OAuth2WindowManager~startLoginWith - Opening auth login window","https://datapower.192.168.13.10.nip.io/pd/sandbox/datapower/oauth2/authorize?response_type=code&state=&client_id=d0189df3de1e32e9ebea9cd7003ef9ac&scope=scope_1&redirect_uri=https%3A%2F%2Fwww.getpostman.com%2Foauth2%2Fcallback"]
[23652][1581515931034][main][info]["OAuth2WindowManager~certificate-error:","net::ERR_CERT_AUTHORITY_INVALID","https://datapower.192.168.13.10.nip.io"]
[23652][1581515931271][main][info]["OAuth2WindowManager~did-navigate:","https://datapower.192.168.13.10.nip.io"]
[23652][1581515931271][main][info]["OAuth2WindowManager~startLoginWith - Received redirect on auth login window"]
[23652][1581515931272][main][info]["OAuth2WindowManager~startLoginWith - URL did not match the registered callbackURL, so skipping"]```
````

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [February 20, 2020, 7:04pm UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914/2 "2020-02-20T19:04:48Z")

</div>

Hi Dan,

It seems like the Certificate Authority (CA) used by `https://datapower.192.168.13.10.nip.io` isn’t recognized in Postman. This is likely either because you’re using a self-signed certificate or a local CA. You can try adding the certificate (in PEM format) via the Settings -\> Certificates dialog under “CA Certificates”.

You can also try disabling “SSL certificate verification” under Settings -\> General if it helps troubleshoot the issue.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![danchirillo](https://avatars.discourse-cdn.com/v4/letter/d/90ced4/32.png) [@danchirillo](https://community.postman.com/u/danchirillo)\
**Post date:** [February 20, 2020, 7:22pm UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914/3 "2020-02-20T19:22:45Z")

</div>

Hi -

SSL verification is disabled. I’m fairly sure that message can be ignored.

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [February 21, 2020, 1:15am UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914/4 "2020-02-21T01:15:44Z")

</div>

@danchirillo,

Ah, I see. It looks like your login page is displaying a Basic Auth login dialog pop-up in the browser. It appears this isn’t captured in Postman’s OAuth dialog window. I believe this could be a legitimate bug, unfortunately.

---

<div class="post-metadata">

**Author:** ![EniElezi](https://avatars.discourse-cdn.com/v4/letter/e/dec6dc/32.png) [@EniElezi](https://community.postman.com/u/EniElezi)\
**Post date:** [January 31, 2022, 12:37pm UTC](https://community.postman.com/t/unable-to-obtain-oauth-access-code/10914/5 "2022-01-31T12:37:44Z")

</div>

Hi,

Has there been a resolution to this? I am having the same “URL did not match the registered callbackURL, so skipping” error!
