Skip to content

SSO Will Not Migrate v1 --> v2 for Some (Valid) Tokens #73

@PrometheusSatyen

Description

@PrometheusSatyen

Bug

PLEASE DO NOT REMOVE THE V1 SSO UNTIL YOU FIX THIS EXTREMELY PROBLEMATIC BUG!

Some v1 tokens, despite being perfectly valid (v1 SSO continues to permit refreshes) fail to migrate to v2 when passed to the v2 endpoint. They can still be refreshed using v1 after this failure.

I can provide examples of such tokens on request. Please email me at prometheussatyen@gmail.com, contact me on TweetFleet Slack (you can find me in #esi or #sso) or contact me on Discord: Prometheus Satyen#3345

Reproduction Steps

Attempt Refresh of Token with v1 SSO:

curl --location --request POST 'https://login.eveonline.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'X-User-Agent: Prometheus Satyen (Pandemic Legion) prometheussatyen@gmail.com' \
--header 'Authorization: Basic REDACTED' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=REDACTED'

Response looks fine, gives a 200 OK:

{
    "access_token": "REDACTED",
    "token_type": "Bearer",
    "expires_in": 1199,
    "refresh_token": "REDACTED"
}

Now, attempt to migrate to v2:

curl --location --request POST 'https://login.eveonline.com/v2/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'X-User-Agent: Prometheus Satyen (Pandemic Legion) prometheussatyen@gmail.com' \
--header 'Authorization: Basic REDACTED' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=REDACTED'

Response is a failure (400 Bad Request):

{
    "error": "invalid_grant",
    "error_description": "Invalid refresh token. Unable to migrate grant."
}

And let's try refresh it with v1 again:

curl --location --request POST 'https://login.eveonline.com/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Accept: application/json' \
--header 'X-User-Agent: Prometheus Satyen (Pandemic Legion) prometheussatyen@gmail.com' \
--header 'Authorization: Basic REDACTED' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=REDACTED'

Response looks fine, gives a 200 OK:

{
    "access_token": "REDACTED",
    "token_type": "Bearer",
    "expires_in": 1199,
    "refresh_token": "REDACTED"
}

🤔

Actual Behaviour

Token fails to migrate.

Expected Behaviour

Token should migrate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions