# \[Resolved\] Authentication failure - Desktop Oauth 2.0 Flow - C#

**URL:** <https://forums.eveonline.com/t/resolved-authentication-failure-desktop-oauth-2-0-flow-c/327273>\
**Category:** Third Party Developers\
**Created:** [September 10, 2021, 10:14pm UTC](https://forums.eveonline.com/t/resolved-authentication-failure-desktop-oauth-2-0-flow-c/327273 "2021-09-10T22:14:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iziel\_Nari-Iri](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/iziel_nari-iri/32/287700_2.png) [@Iziel\_Nari-Iri](https://forums.eveonline.com/u/Iziel_Nari-Iri)\
**Post date:** [September 10, 2021, 10:14pm UTC](https://forums.eveonline.com/t/resolved-authentication-failure-desktop-oauth-2-0-flow-c/327273/1 "2021-09-10T22:14:50Z")

</div>

Hello,  
I have some prob with authenticated request to ESI.

Example :  
GET [https://esi.evetech.net/latest/characters/Character\_Id/skills/?datasource=tranquility](https://esi.evetech.net/latest/characters/Character_Id/skills/?datasource=tranquility)

Base Url =\> [https://esi.evetech.net](https://esi.evetech.net)  
Route =\> /latest/characters/Character\_Id/skills

```
    public static string GetAuthenticatedInformation(string BaseURL, string Route)
    {
        string HeaderAccessToken = "Bearer+".Replace("+"," ")+ GetCurrentToken();
        var client = new RestClient(BaseURL);
        var request = new RestRequest(Route);
        request.AddParameter("datasource", "tranquility");
        request.AddHeader("Authorization", HeaderAccessToken);
        var response = client.Get(request);
        return response.Content;
    }

```

Reponse =\> {“error” : “authentication failure”}

if I try with param

```
        string HeaderAccessToken = "Bearer+".Replace("+"," ")+ GetCurrentToken();
        var client = new RestClient(BaseURL);
        var request = new RestRequest(Route);
        request.AddParameter("datasource", "tranquility");
        request.AddParameter("token", HeaderAccessToken);

```

=\> latest/characters/Charcter\_Id/skills/?datasource=tranquility&token=%20eyJhbGciOiJSUzI1N…  
Reponse =\> {“error” : “authentication failure”}

On Postman :

 ![image](https://global.discourse-cdn.com/eveonline/original/4X/d/0/7/d079635dbc46afcadc10cdc34867c641d3769d39.png)

I use Desktop/Mobile Oauth 2.0 Flow  
on the other hand, no problem to refresh the token

I also tried with

```
        string HeaderAccessToken = "Bearer+".Replace("+"," ")+ GetCurrentToken();
        var client = new RestClient(BaseURL);
        var request = new RestRequest(Route);
        request.AddParameter("datasource", "tranquility");
        client.Authenticator = new HttpBasicAuthenticator("Bearer", HeaderAccessToken);
        var response = client.Get(request);
        return response.Content;

```

Maybe a token too long?

My token with the full scope is 4079 characters

Any Idea?

---

<div class="post-metadata">

**Author:** ![Iziel\_Nari-Iri](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/iziel_nari-iri/32/287700_2.png) [@Iziel\_Nari-Iri](https://forums.eveonline.com/u/Iziel_Nari-Iri)\
**Post date:** [September 10, 2021, 10:31pm UTC](https://forums.eveonline.com/t/resolved-authentication-failure-desktop-oauth-2-0-flow-c/327273/2 "2021-09-10T22:31:03Z")

</div>

I solved the problem …

Token was too long damn…

---

<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:** [December 9, 2021, 10:31pm UTC](https://forums.eveonline.com/t/resolved-authentication-failure-desktop-oauth-2-0-flow-c/327273/3 "2021-12-09T22:31:39Z")

</div>

Closed on December 9, 2021, 10:31pm UTC

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