# AuthApiError in chrome - xhr Type Error

**URL:** <https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730>\
**Category:** Questions\
**Created:** [February 1, 2021, 5:39pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730 "2021-02-01T17:39:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvr](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kvr](https://devforum.okta.com/u/kvr)\
**Post date:** [February 1, 2021, 5:39pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/1 "2021-02-01T17:39:14Z")

</div>

I am able to login to my application in IE in production… But not able to get the token in chrome. Getting below error while parsing the code . It is failing on here oktaAuth.token.parseFromUrl()

1. xhr: TypeError: Network request failed at XMLHttpRequest.E.s.onerror ([https://global.oktacdn.com/okta-auth-js/4.0.0/okta-auth-js.min.js:160:7646](https://global.oktacdn.com/okta-auth-js/4.0.0/okta-auth-js.min.js:160:7646))

2. message: “Network request failed”

3. stack: “TypeError: Network request failed↵ at XMLHttpRequest.E.s.onerror ([https://global.oktacdn.com/okta-auth-js/4.0.0/okta-auth-js.min.js:160:7646](https://global.oktacdn.com/okta-auth-js/4.0.0/okta-auth-js.min.js:160:7646))”

Not sure where to look for. Currently this is happening in production for some users.  
Any help is much appreciated. Thanks

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [February 1, 2021, 11:34pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/2 "2021-02-01T23:34:55Z")

</div>

Hello,  
If you can reproduce this can you supply the console log and .har file?  
For the users is fails for, does it always fail, or just randomly?

---

<div class="post-metadata">

**Author:** ![kvr](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kvr](https://devforum.okta.com/u/kvr)\
**Post date:** [February 2, 2021, 11:35pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/3 "2021-02-02T23:35:33Z")

</div>

this is failing from oktaAuth.token.parseFromUrl() and seeing below error. Not sure where this is failing at… I dont see any call is being made to okta to get the token at this point of time… but somewhere it is failed

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/4/492f06cde6e0a9dc60fe699ea672309f88ef09cb.png)

xhr: I modified the urls in below xhr

“\_priority”: “High”,  
“\_resourceType”: “xhr”,  
“cache”: {},  
“pageref”: “page\_4”,  
“request”: {  
“method”: “POST”,  
“url”: “https://{our tenant}/oauth2/{ourauth}/v1/token”,  
“httpVersion”: “”,  
“headers”: [  
{  
“name”: “Host”,  
“value”: “our tenant”  
},  
{  
“name”: “Connection”,  
“value”: “keep-alive”  
},  
{  
“name”: “Content-Length”,  
“value”: “234”  
},  
{  
“name”: “accept”,  
“value”: “application/json”  
},  
{  
“name”: “x-okta-user-agent-extended”,  
“value”: “okta-auth-js/4.0.0”  
},  
{  
“name”: “User-Agent”,  
“value”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36”  
},  
{  
“name”: “content-type”,  
“value”: “application/x-www-form-urlencoded”  
},  
{  
“name”: “Origin”,  
“value”: “[https://oururl](https://oururl)”  
},  
{  
“name”: “Sec-Fetch-Site”,  
“value”: “cross-site”  
},  
{  
“name”: “Sec-Fetch-Mode”,  
“value”: “cors”  
},  
{  
“name”: “Sec-Fetch-Dest”,  
“value”: “empty”  
},  
{  
“name”: “Referer”,  
“value”: “[https://referrer](https://referrer) url”  
},  
{  
“name”: “Accept-Encoding”,  
“value”: “gzip, deflate, br”  
},  
{  
“name”: “Accept-Language”,  
“value”: “en-US,en;q=0.9”  
}  
],  
“queryString”: ,  
“cookies”: ,  
“headersSize”: -1,  
“bodySize”: 234,  
“postData”: {  
“mimeType”: “application/x-www-form-urlencoded”,  
“text”: “client\_id=clientid&redirect\_uri=https%3A%2F%2Foururl%2F&grant\_type=authorization\_code&code=code&code\_verifier=verifier”,  
“params”: [  
{  
“name”: “client\_id”,  
“value”: “clientid”  
},  
{  
“name”: “redirect\_uri”,  
“value”: “https%3A%2F%2Fredirecturl%2F”  
},  
{  
“name”: “grant\_type”,  
“value”: “authorization\_code”  
},  
{  
“name”: “code”,  
“value”: “code”  
},  
{  
“name”: “code\_verifier”,  
“value”: “code-verifier”  
}  
]  
}  
},  
“response”: {  
“status”: 0,  
“statusText”: “”,  
“httpVersion”: “”,  
“headers”: ,  
“cookies”: ,  
“content”: {  
“size”: 0,  
“mimeType”: “x-unknown”  
},  
“redirectURL”: “”,  
“headersSize”: -1,  
“bodySize”: -1,  
“\_transferSize”: 0,  
“\_error”: “net::ERR\_CONNECTION\_RESET”  
},  
“serverIPAddress”: “”,  
“startedDateTime”: “2021-02-02T23:27:07.512Z”,  
“time”: 609.566997,  
“timings”: {  
“blocked”: 609.566997,  
“dns”: -1,  
“ssl”: -1,  
“connect”: -1,  
“send”: 0,  
“wait”: 0,  
“receive”: 0,  
“\_blocked\_queueing”: -1  
}  
},

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [February 3, 2021, 1:57am UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/4 "2021-02-03T01:57:34Z")

</div>

Does this happen all the time, or just some of the time, or just for certain clients?

The network error you are getting is a connection reset. I recommend opening a ticket with support. That way we can gather specific information about your Org and see if we see any issues in the configuration.

---

<div class="post-metadata">

**Author:** ![kvr](https://avatars.discourse-cdn.com/v4/letter/k/e79b87/32.png) [@kvr](https://devforum.okta.com/u/kvr)\
**Post date:** [February 3, 2021, 2:10pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/5 "2021-02-03T14:10:51Z")

</div>

This is happening only in chrome if I connected to VPN.

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [February 4, 2021, 8:33pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/6 "2021-02-04T20:33:49Z")

</div>

If you have a single machine that has chrome and some other browser (IE) on it, and the other browser is able to login fine, but chrome gets connection resets, I would suggest checking chromes browser settings.

From Okta, you can set blocked networks, but you would get a 401, not a connection reset, which really sounds like a networking or device issue.

I recommend opening a support ticket since information about you Org will be needed to help assist and see if the issue might be on the Okta side.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 26, 2024, 6:42pm UTC](https://devforum.okta.com/t/authapierror-in-chrome-xhr-type-error/12730/7 "2024-01-26T18:42:42Z")

</div>


