# SSO Endpoint Deprecations - Official Blog

**URL:** <https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083>\
**Category:** Third Party Developers\
**Created:** [October 6, 2021, 6:49pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083 "2021-10-06T18:49:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [October 6, 2021, 6:49pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/1 "2021-10-06T18:49:38Z")

</div>

[https://developers.eveonline.com/blog/article/sso-endpoint-deprecations-2](https://developers.eveonline.com/blog/article/sso-endpoint-deprecations-2)

I didn’t write it, but if you’re working with SSO and ESI, you probably want to read this.

tl;dr: V1 auth is being turned off some time after November 1st. And refresh tokens may start changing.

---

<div class="post-metadata">

**Author:** ![Amsen\_Manaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/amsen_manaken/32/283708_2.png) [@Amsen\_Manaken](https://forums.eveonline.com/u/Amsen_Manaken)\
**Post date:** [October 6, 2021, 8:28pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/2 "2021-10-06T20:28:36Z")

</div>

In php i do this now :

$url=‘[https://login.eveonline.com/oauth/token](https://login.eveonline.com/oauth/token)’;  
$verify\_url=‘[https://login.eveonline.com/oauth/verify](https://login.eveonline.com/oauth/verify)’;

is this the new ? i am not calling oauth/token in other parts

$url=‘[https://login.eveonline.com/v2/oauth/authorize](https://login.eveonline.com/v2/oauth/authorize)’;  
$verify\_url=‘[https://login.eveonline.com/v2/oauth/token](https://login.eveonline.com/v2/oauth/token)’;

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [October 6, 2021, 8:37pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/3 "2021-10-06T20:37:17Z")

</div>

There’s no verify url any more. When you get the token, it contains the user id in what’s known as a jwt. This is your access token.

```auto
$jwtexplode=json_decode(base64_decode(str_replace('_', '/', str_replace('-','+',explode('.',$accesstoken )[1]))));
$charactername=$jwtexplode->name;
$characterid=explode(":",$jwtexplode->sub)[2];

```

Now, you _could_ go and verify it. But as you’re getting it direct from CCP, that’s not exactly a requirement 😉

---

<div class="post-metadata">

**Author:** ![Amsen\_Manaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/amsen_manaken/32/283708_2.png) [@Amsen\_Manaken](https://forums.eveonline.com/u/Amsen_Manaken)\
**Post date:** [October 6, 2021, 8:44pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/4 "2021-10-06T20:44:45Z")

</div>

I go to check when home.

A people say in reddit than v2 show the protraits of the characters and v1 the combo with the names only, is this correct ?

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [October 6, 2021, 8:48pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/5 "2021-10-06T20:48:57Z")

</div>

Yep, I believe so.  
Also, they’ll send you to [https://login.eveonline.com/oauth/authorize](https://login.eveonline.com/oauth/authorize)  
not [https://login.eveonline.com/v2/oauth/authorize](https://login.eveonline.com/v2/oauth/authorize)

---

<div class="post-metadata">

**Author:** ![Amsen\_Manaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/amsen_manaken/32/283708_2.png) [@Amsen\_Manaken](https://forums.eveonline.com/u/Amsen_Manaken)\
**Post date:** [October 6, 2021, 8:50pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/6 "2021-10-06T20:50:12Z")

</div>

wel… time to programming. My work is that but CCP re more compicated than invoice for the IRS.

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [October 6, 2021, 8:54pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/7 "2021-10-06T20:54:04Z")

</div>

I’ll be redoing my own released code for this stuff over the next week or so (unless something comes up.)

So there will be examples. 🙂

---

<div class="post-metadata">

**Author:** ![Amsen\_Manaken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/amsen_manaken/32/283708_2.png) [@Amsen\_Manaken](https://forums.eveonline.com/u/Amsen_Manaken)\
**Post date:** [October 6, 2021, 8:58pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/8 "2021-10-06T20:58:08Z")

</div>

Many thanks.

---

<div class="post-metadata">

**Author:** ![Heritor\_Skoliya](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/heritor_skoliya/32/388743_2.png) [@Heritor\_Skoliya](https://forums.eveonline.com/u/Heritor_Skoliya)\
**Post date:** [October 10, 2021, 4:50pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/9 "2021-10-10T16:50:29Z")

</div>

If somebody’s interested in how to do login now, and how to verify a token from SSO in NodeJS, here is an example code I use on my site.

My login process consists of 2 parts. First one is an initial stage, and, actually, here I just redirect people to [login.eveonline.com](http://login.eveonline.com).

```auto
const params = new URLSearchParams({
    response_type: 'code',
    redirect_uri: encodeURI(eveSsoRedirectUri),
    client_id: eveSsoClientId,
    scope: '',
    state,
});

throw new RedirectTemporarily(`https://login.eveonline.com/v2/oauth/authorize?${params.toString()}`);

```

The `eveSsoRedirectUri` is the “Callback Url” from my app settings.

Nothing complex here, and, comparing to V1 scheme, you only change `oauth/authorize` to `v2/oauth/authorize`.

Second part is the page to where you are redirected after successful auth on [login.eveonline.com](http://login.eveonline.com) (the page you have set as “Callback Url” for you app). In this page I call `tokenFromEveSsoCode` function passing received `code` as a param.

```auto
async function tokenFromEveSsoCode(code) {
    // If you use jose prior to v4, import them that way:
    // const {importJWK} = require('jose/key/import');
    // const {jwtVerify} = require('jose/jwt/verify');
    // For jose version 4+
    const {importJWK, jwtVerify} = require('jose');

    const eveSsoClientId = 'Application Settings → Client ID';
    const eveSsoSecretKey = 'Application Settings → Secret Key';
    const params = new URLSearchParams({grant_type: 'authorization_code', code});
    const authInfo = Buffer.from(`${eveSsoClientId}:${eveSsoSecretKey}`).toString('base64');

    const [tokenInfo, signatures] = await Promise.all([
        simpleJsonRequest(
            'https://login.eveonline.com/v2/oauth/token',
            params.toString(),
            'POST',
            {"Authorization": `Basic ${authInfo}`}
        ),
        simpleJsonRequest('https://login.eveonline.com/oauth/jwks'),
    ]);

    if (!isObject(signatures)) {
        console.log(signatures);
        throw new Error('Incorrect JWKS signatures from EVE Online (printed above)');
    }

    if (!signatures.hasOwnProperty('keys')) {
        console.log(signatures);
        throw new Error('Cannot find keys in JWKS signatures from EVE Online (printed above)');
    }

    const alg = 'RS256';
    let jwkSetKey = null;
    signatures.keys.map(key => {
        if (key.alg === alg) {
            jwkSetKey = key;
        }
    });

    if (!jwkSetKey) {
        console.log(signatures);
        throw new Error(`Cannot find the ${alg} algo in JWKS signatures from EVE Online (printed above)`);
    }

    const publicKey = await importJWK(jwkSetKey);

    const {payload} = await jwtVerify(tokenInfo['access_token'], publicKey, {
        issuer: 'login.eveonline.com',
    });

    tokenInfo.payload = payload;

    return tokenInfo;
}

```

I use the “jose” library to verify token, and I’ve found it on [https://jwt.io/](https://jwt.io/) which contains a lot of links to JWT libraries for different tastes and languages. (EVE Online developers suggested to use the site in the devblog, but I’ve found the site even before this devblog was published.)

The `simpleJsonRequest` function you can notice in code, is my internal HTTP helper, and I mention it just to describe that: 1st parameter is target URL, 2nd one is POST data (and when I pass it this way — like a string — it always sends data as `application/x-www-form-urlencoded`), 3rd parameter is a request method, and 4th — additional headers. As you can see, when you fetch token from `https://login.eveonline.com/v2/oauth/token`, you need to provide some auth info in header, and it’s just Base64-encoded `[Client ID][colon][Secret Key]` string — pretty easy to create it.

To verify token, I fetch EVE Online signatures from `https://login.eveonline.com/oauth/jwks`, pick a signature which use `RS256`, and convert it to public key by using jose’s function `importJWK`. After that I use jose’s function `jwtVerify` to both verify token and convert it to JSON payload (the payload contains all needed info like character ID which was used on [login.eveonline.com](http://login.eveonline.com) to allow your auth, expiration info, and etc.).

So, to summarize things, if you was verifying tokens before Nov 1st by using special `oauth/verify` verification endpoint, new way of verifying tokens does not reduce amount of HTTP calls (but it’s possible to reduce it by caching `https://login.eveonline.com/oauth/jwks` data somewhere in your code).

Also, if you do not want to verify token, you just can convert `tokenInfo['access_token']` (which presented as a Base64-encoded string) to JSON data manually (sorry, I forgot how I did that when I was debugging things, but you may want to check this SO thread for needed info: [https://stackoverflow.com/questions/52863051/decode-jwt-token-in-node-without-library](https://stackoverflow.com/questions/52863051/decode-jwt-token-in-node-without-library)).

Hope this short guide will help you to convert your code to V2.

---

<div class="post-metadata">

**Author:** ![Tonto\_Auri](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/tonto_auri/32/388339_2.png) [@Tonto\_Auri](https://forums.eveonline.com/u/Tonto_Auri)\
**Post date:** [October 28, 2021, 9:38am UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/10 "2021-10-28T09:38:30Z")

</div>

> [@Steve\_Ronuken](#):
>
> `str_replace('_', '/', str_replace`

[PHP: str\_replace - Manual](https://www.php.net/str_replace#example-4806) accepts arrays as search and replace, doing pairs.

---

<div class="post-metadata">

**Author:** ![Steve\_Ronuken](https://sea1.discourse-cdn.com/eveonline/user_avatar/forums.eveonline.com/steve_ronuken/32/373894_2.png) [@Steve\_Ronuken](https://forums.eveonline.com/u/Steve_Ronuken)\
**Post date:** [October 28, 2021, 2:23pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/11 "2021-10-28T14:23:15Z")

</div>

I’ll freely admit that I brazenly stole that one liner for decoding JWTs from stack overflow.

---

<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:** [January 26, 2022, 2:23pm UTC](https://forums.eveonline.com/t/sso-endpoint-deprecations-official-blog/331083/12 "2022-01-26T14:23:31Z")

</div>

Closed on January 26, 2022, 2:23pm UTC

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