# ESI SSO giving 401 Unauthorized error when requesting for token

**URL:** <https://forums.eveonline.com/t/esi-sso-giving-401-unauthorized-error-when-requesting-for-token/96965>\
**Category:** Third Party Developers\
**Created:** [August 10, 2018, 3:05pm UTC](https://forums.eveonline.com/t/esi-sso-giving-401-unauthorized-error-when-requesting-for-token/96965 "2018-08-10T15:05:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kenneth\_Dallocort](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/kenneth_dallocort/32/136745_2.png) [@Kenneth\_Dallocort](https://forums.eveonline.com/u/Kenneth_Dallocort)\
**Post date:** [August 10, 2018, 3:05pm UTC](https://forums.eveonline.com/t/esi-sso-giving-401-unauthorized-error-when-requesting-for-token/96965/1 "2018-08-10T15:05:07Z")

</div>

I am developing a web based application for the game. I was able to get the authorization code. But when I try to request for an access token, I was getting the 401 error.

I tried with the fiddler to see what was happening and I still got the 401 error. The below is the sample fiddler request I used

> POST [https://login.eveonline.com/oauth/token](https://login.eveonline.com/oauth/token) HTTP/1.1
> 
> Authorization: Basic [censored]  
> Content-Type: application/json  
> Host: [login.eveonline.com](http://login.eveonline.com)
> 
> {  
> “grant\_type”:“authorization\_code”,  
> “code”:“[censored]”  
> }

Any help would be appreciated.

Thank you.

---

<div class="post-metadata">

**Author:** ![Kenneth\_Dallocort](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/kenneth_dallocort/32/136745_2.png) [@Kenneth\_Dallocort](https://forums.eveonline.com/u/Kenneth_Dallocort)\
**Post date:** [August 10, 2018, 3:10pm UTC](https://forums.eveonline.com/t/esi-sso-giving-401-unauthorized-error-when-requesting-for-token/96965/2 "2018-08-10T15:10:15Z")

</div>

I found the mistake. I had given a one line space between POST and Authorization. Removing it worked.

> POST [https://login.eveonline.com/oauth/token](https://login.eveonline.com/oauth/token) HTTP/1.1  
> Authorization: Basic [censored]  
> Content-Type: application/json  
> Host: [login.eveonline.com](http://login.eveonline.com)
> 
> {  
> “grant\_type”:“authorization\_code”,  
> “code”:“[censored]”  
> }

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/eveonline/original/3X/4/1/41ec4921cbaca7a6f9ea556e7cc20018461eae5e.png) [@system](https://forums.eveonline.com/u/system)\
**Post date:** [November 8, 2018, 3:10pm UTC](https://forums.eveonline.com/t/esi-sso-giving-401-unauthorized-error-when-requesting-for-token/96965/3 "2018-11-08T15:10:19Z")

</div>

Closed on November 8, 2018, 3:10pm UTC

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