question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scope changes causing authentication to fail for EVEOnline provider

See original GitHub issue

Description 🐜

Scope parameter in EVEOnlline provider is being overwritten with “openid”

The EVEOnline provider requires there to be NO scope parameter. However in the provider code it is specified as “publicData” but it’s not even using that?

..., wellKnown: "https://login.eveonline.com/.well-known/oauth-authorization-server", authorization: { params: { scope: "publicData", }, },

However, when the login URL is constructed we get this:

url: 'https://login.eveonline.com/oauth/authorize?client_id=*redacted*&scope=openid&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fapi%2Fauth%2Fcallback%2Feveonline&nextauth=signin%2Ceveonline&state=GejPhUb_qWw8yj03eDsaDqmuN-tL1BLmXy3iRYW2Z-E

See in the URL that scope=openid … does anyone know why this is happening? EVEOnline reports a authentication error saying the scope is invalid. Is there a way to completely remove the scope parameter from the login URL?

Is this a bug in your own project?

Yes

How to reproduce ☕️

Use the auth provider for EVEOnline. You’ll need to get a developer API key which you can get from https://developers.eveonline.com/applications

Screenshots / Logs 📽

image image

Environment 🖥

System: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 4.19 GB / 15.93 GB Binaries: Node: 17.0.1 - E:\Program Files\nodejs\node.EXE npm: 8.1.2 - E:\Program Files\nodejs\npm.CMD Browsers: Chrome: 97.0.4692.99 Edge: Spartan (44.19041.1266.0), Chromium (97.0.1072.69) Internet Explorer: 11.0.19041.1202 npmPackages: next: ^12.0.9 => 12.0.9 next-auth: ^4.0.0-beta.7 => 4.0.0-beta.7 react: 17.0.2 => 17.0.2

Contributing 🙌🏽

Yes, I am willing to help solve this bug in a PR

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
brownoxfordcommented, Sep 29, 2022

The Eve login endpoint does not return an id_token, so the eve configuration should be specifying idToken:false instead of true. This will lead to the login process trying to get at the userinfo_endpoint to look up user information, but the configured wellKnown of https://login.eveonline.com/.well-known/oauth-authorization-server does not provide that either.

The solution is to copy the EVEOnline configuration to your local code, set idToken to false, remove wellKnown, and manually specify authorization, token and userinfo.

0reactions
geraldm74commented, Jan 30, 2022

Update:

Adding the following code to the EVEOnline Provider options fixed the id_token problem:

token: { async request({ client, provider, params, checks }) { const tokens = await client.oauthCallback( provider.callbackUrl, params, checks ) tokens.id_token = tokens.access_token return { tokens } }, }

The OAuth profile data is returned correctly as follows:

[next-auth][debug][PROFILE_DATA] { OAuthProfile: { scp: ‘publicData’, jti: ‘e8352ed6-6dab-4031-bc00-b4fa347ef756’, kid: ‘JWT-Signature-Key’, sub: ‘CHARACTER:EVE:----’, azp: ‘ab0f323397e04cc28718b0381965fa34’, tenant: ‘tranquility’, tier: ‘live’, region: ‘world’, name: ‘----’, owner: ‘Oz7Q/sor0EvZ4VQwNCN35lk6uZc=’, exp: 1643583849, iat: 1643582649, iss: ‘login.eveonline.com’ } }

However I then get a new error: [next-auth][error][OAUTH_PARSE_PROFILE_ERROR]

https://next-auth.js.org/errors#oauth_parse_profile_error Cannot read properties of undefined (reading ‘toString’) { error: { message: “Cannot read properties of undefined (reading ‘toString’)”, stack: “TypeError: Cannot read properties of undefined (reading ‘toString’)\n” …, name: ‘TypeError’ },

After this error I see the following:

[next-auth][debug][OAUTH_CALLBACK_RESPONSE] { profile: null, account: null, OAuthProfile: { scp: ‘publicData’, jti: ‘e8352ed6-6dab-4031-bc00-b4fa347ef756’, kid: ‘JWT-Signature-Key’, sub: ‘CHARACTER:EVE:----’, azp: ‘ab0f323397e04cc28718b0381965fa34’, tenant: ‘tranquility’, tier: ‘live’, region: ‘world’, name: ‘----’, owner: ‘Oz7Q/sor0EvZ4VQwNCN35lk6uZc=’, exp: 1643583849, iat: 1643582649, iss: ‘login.eveonline.com’ } }

I’m assuming the undefined error message is to do with profile and account being null? Does anyone know why this is?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Authentication works but cant use token in ESI call
I am right to assume that the validation is just to confirm the token is valid and does not change the token in...
Read more >
Alliance Auth Documentation - Read the Docs
Welcome to the official documentation for Alliance Auth! Alliance Auth is a web site that helps Eve Online organizations efficiently manage access to ......
Read more >
Providers — django-allauth 0.43.0 documentation
An error occurred while attempting to login via your social network account. ... If you'd like to change this set the scope to...
Read more >
EVE Online Current - Wine Application Database - WineHQ
Open Source Software for running Windows applications on other operating systems.
Read more >
Untitled
#new Blacktree technical group, Best subs in the world, Examen practico a1 con scooter, Eap-peap authentication failed, Wierchomla kamery hotel, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found