# EVE SSO/ESI verify with Angular/TypeScript

**URL:** <https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728>\
**Category:** Third Party Developers\
**Tags:** esi\
**Created:** [January 11, 2019, 1:40pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728 "2019-01-11T13:40:13Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 11, 2019, 1:40pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/1 "2019-01-11T13:40:13Z")

</div>

Hi

I’m trying to load the ClientID in Angular with TypeScript. The whole OAuth2 solution works. I have a token. But as soon as I want to do the verify, for a clientID, nothing works anymore.

My token:

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/8/b/8bb21302515b99edee0de156e6828ebfa9534d52.png)

Bud verify dosn’t work. My code:

```
    OnGetUser() {
    const headerss = new HttpHeaders();
    headerss = headerss.set('Authorization', 'Bearer ' + this.bearerToken);
    this.http.get('https://esi.tech.ccp.is/verify', {headers: headers}).pipe(first()).subscribe((user: any) => {
        console.log(user);
    }, (error) => {
        console.log(error);
    });
}

```

The response is always a CORS failure. The error:

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/9/7/97dab81d38ce4948dca0bed8db0d8524fd646dcd.png)  
What’s my problem?

Gruss  
Roland

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [January 11, 2019, 2:50pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/2 "2019-01-11T14:50:35Z")

</div>

> <https://github.com/esi/esi-docs/blob/master/docs/sso/validating_eve_jwt.md>

That would be what you want. You can validate the token locally, as the token is a JWT token. That endpoint would be used server side to validate v1 tokens.

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 11, 2019, 3:09pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/3 "2019-01-11T15:09:33Z")

</div>

Hi

Thank for the fast response.

For my understanding. The CORS exception result from? Or you mean my characterID is encoded in the token?  
I’ve analysed my token with [https://jwt.io/](https://jwt.io/). The token is valid but I can’t see my characterID. I search my id in an Android App and test it with get standings. But the same issue.

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/6/9/69b86d1987a54d5248fdce70c3c1457f83f9446c.png)

I’ve only one header and use GET. This is ok?

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/7/4/742fbb8950422e3a8431764adae702f0166d986e.png)

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [January 11, 2019, 3:21pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/4 "2019-01-11T15:21:12Z")

</div>

First of all you are using the old ESI url which doesn’t exist anymore. You should be using `https://esi.evetech.net` as the base for ESI requests, (only ESI requests, not SSO).

Once you switch to the correct URL you original `/verify/` request will work. Just won’t be required as all the same info is in the token.

Your characterID is in the token:

```auto
...
"sub": "CHARACTER:EVE:123456789",
...

```

Where it is the number in the `sub` property.

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 11, 2019, 4:00pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/5 "2019-01-11T16:00:14Z")

</div>

Many thanks. The CORS problem is solved with this url.  
[https://esi.evetech.net/latest/characters/${character\_id}/standings/](https://esi.evetech.net/latest/characters/%24%7Bcharacter_id%7D/standings/)  
But now … 403… :-/  
I meant that was easier.

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/a/b/abc535f3ed2b6991b7650791d67f75b3507ee7be.png)

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 11, 2019, 4:22pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/6 "2019-01-11T16:22:03Z")

</div>

I’ve parse my token in my code. The token is ok.

```
{
  "scp": [
	"publicData",
	"esi-calendar.respond_calendar_events.v1",
	...
	"esi-corporations.read_outposts.v1",
	"esi-characterstats.read.v1"
  ],
  "jti": "2c091c69-b90b-4388-af8f-728cf9dd58cc",
  "kid": "JWT-Signature-Key",
  "sub": "CHARACTER:EVE:2114826488",
  "azp": "e8c5338545274f5d917cfae15d5aca2e",
  "name": "TheBadSenior Momaki",
  "owner": "RmwBYWpPah1FQTHeAVp2qGZzQDA=",
  "exp": 1547223985,
  "iss": "login.eveonline.com"
}

```

expdate is also ok.

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/4/7/471cb0e2312ab1dba14e23a9697addf2db2925ec.png)

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [January 11, 2019, 4:54pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/7 "2019-01-11T16:54:28Z")

</div>

Make sure you are setting the token to be the whole JWT token. Not just the first part of it like you have in your picture.

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 11, 2019, 5:49pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/8 "2019-01-11T17:49:20Z")

</div>

I send the whole token.

 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/c/a/ca6b60041a6033cc580820855aebef3f090945b7.png)  
The token I was send is the access\_token property.  
 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/c/f/cfc1b0faecff9eab5dd469ce2ad09825eec8136b.png)  
I extract the token and save it as token.  
 ![grafik](https://global.discourse-cdn.com/eveonline/original/3X/6/e/6e4f0eda8be4e5e0931ca89851e5c62ce87faddd.png)  
This token use it in the header as Bearer token.

---

<div class="post-metadata">

**Author:** ![Blacksmoke16](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/blacksmoke16/32/376589_2.png) [@Blacksmoke16](https://forums.eveonline.com/u/Blacksmoke16)\
**Post date:** [January 11, 2019, 7:41pm UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/9 "2019-01-11T19:41:40Z")

</div>

Confirm that its setting the header correctly. It looks, from the log there, its setting the `Authorization` header to an array, when it should just be like `"Authorization: Bearer TOKEN"`.

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 15, 2019, 9:40am UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/10 "2019-01-15T09:40:16Z")

</div>

Hi  
I have tested a lot more. Without success. The response is always a 403. I use code from my other projects. Therefore, I suspect the error as with my token.  
Do you know an Angular project that works? Where to look for it?

---

<div class="post-metadata">

**Author:** ![TheBadSenior\_Momaki](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/thebadsenior_momaki/32/303091_2.png) [@TheBadSenior\_Momaki](https://forums.eveonline.com/u/TheBadSenior_Momaki)\
**Post date:** [January 16, 2019, 7:17am UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/11 "2019-01-16T07:17:34Z")

</div>

I could solve the Problem.

> <https://github.com/esi/esi-issues/issues/1089>

---

<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:** [April 16, 2019, 7:17am UTC](https://forums.eveonline.com/t/eve-sso-esi-verify-with-angular-typescript/132728/12 "2019-04-16T07:17:48Z")

</div>

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