timthedevguy / BuySYS

*NO LONGER MAINTAINED* Buyback application for EveOnline, can be used by Corporations/Alliances or private entities. Written in PHP 7.4
10 stars 3 forks source link

Auth method migration from v1 to v2 #36

Closed Valiantiam closed 2 years ago

Valiantiam commented 2 years ago

Started over the last few days. I tested some other corporations buysys installs and they are having the same issues. Is it possible something with CCP auth has changed causing the auth method buysys is using to not work anymore?

image

The above screen is shown immediately after choosing which character to authenticate with and clicking confirm

Valiantiam commented 2 years ago

I believe this is all related to this change:

https://forums.eveonline.com/t/information-on-changes-to-esi-for-third-party-applications/334081

Valiantiam commented 2 years ago

Can confirm there are changes needed to this app for auth going forward.

https://github.com/esi/esi-docs/pull/65/commits/0d9b2b1fe1eee1e64172aaa7f91c54261e2cc2fc

Here is some additional documentation.

4tt1c commented 2 years ago

Are there any fixes already?

Valiantiam commented 2 years ago

Not beyond the documentation I provided above. I'm by no means even a "part time" developer so its all beyond my ability but someone could make a pull request with the necessary changes regarding authentication.

Valiantiam commented 2 years ago

I have tried looking into this myself and changing some values in the configs / auth scripts but to no result.

@timthedevguy have you had a chance to look at this at all?

timthedevguy commented 2 years ago

I haven't heard of this, let me do some research and figure out what they changed! I'll get back to you here!

Valiantiam commented 2 years ago

Hey there! Any luck? Can I help test by making a few changes on my install for you?

timthedevguy commented 2 years ago

I will be tackling this sometime this weekend, sorry, real life job is crazy right now.

4tt1c commented 2 years ago

If we can help you in any way, just let us know.

timthedevguy commented 2 years ago

Looks like it's not the auth change, it's the v4/Characters route deprecation that caused the issue. Switched route to v5/Characters and I can log in successfully now.

entropylaw commented 2 years ago

2021-11-08 03:39:13] request.CRITICAL: Uncaught PHP Exception GuzzleHttp\Exception\ClientException: "Client error: POST https://login.eveonline.com/oauth/token?grant_type=authorization_code&code=xxx resulted in a 400 Bad Request response: {"error":"invalid_request","error_description":"Invalid authorization code, decrypt failed"} " at /var/www/BuySYS/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php line 113 {"exception":"[object] (GuzzleHttp\Exception\ClientException(code: 400): Client error: POST https://login.eveonline.com/oauth/token?grant_type=authorization_code&code=xxxx resulted in a 400 Bad Request response:\n{\"error\":\"invalid_request\",\"error_description\":\"Invalid authorization code, decrypt failed\"}\n at /var/www/BuySYS/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)"} []

timthedevguy commented 2 years ago

Thanks for the update Entropy, I'll take a look, mine is authenticating no problem :(

image

timthedevguy commented 2 years ago

@Valiantiam and @4tt1c are you able to log in after updating your code?

Valiantiam commented 2 years ago

@Valiantiam and @4tt1c are you able to log in after updating your code?

Mine is working now! THANK YOU!

timthedevguy commented 2 years ago

@entropylaw Based on the articles published by CCP I'm wondering if the stored Refresh Token for your user is the old one....You can try removing the Refresh Token from your user field in the database as a test.

Valiantiam commented 2 years ago

@entropylaw I would also make sure to run the update commands to clear some stuff in cache too.

php bin/console cache:clear --env=prod --no-warmup php bin/console cache:warmup --env=prod

entropylaw commented 2 years ago

@entropylaw I would also make sure to run the update commands to clear some stuff in cache too.

php bin/console cache:clear --env=prod --no-warmup php bin/console cache:warmup --env=prod

yes. thats in my update.sh

entropylaw commented 2 years ago

Found that src/AppBundle/Utilities/SSO.php is pointing to v1 of oauth instead of v2. http://login.eveonline.com/v2/oauth/

Even when changes to v2. It generates this new error below with 'Grant Type not supported'

New error. [2021-11-11 02:43:55] request.CRITICAL: Uncaught PHP Exception GuzzleHttp\Exception\ClientException: "Client error:POST https://login.eveonline.com/v2/oauth/token?grant_type=authorization_code&code=xxxxresulted in a400 Bad Requestresponse: {"error":"invalid_grant","error_description":"Grant type is not supported."} " at /var/www/BuySYS/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php line 113 {"exception":"[object] (GuzzleHttp\\Exception\\ClientException(code: 400): Client error:POST https://login.eveonline.com/v2/oauth/token?grant_type=authorization_code&code=xxxxresulted in a400 Bad Requestresponse:\n{\"error\":\"invalid_grant\",\"error_description\":\"Grant type is not supported.\"}\n at /var/www/BuySYS/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)"} []

4tt1c commented 2 years ago

@Valiantiam and @4tt1c are you able to log in after updating your code?

Sorry for the late reply. Yes, mine is also working fine now.