EsiPy Authentification fail - python


I try to use the EsiPy to authenticate a user and grab information from the API.
I use flask as an application server when I tried to log one of my characters I receives the following error message :
Login EVE Online SSO failed: HTTP Error 400: b’{“error”:“invalid_grant”,“error_description”:“Grant type authorization_code is not supported.”}’

The error message comes when I try to obtain a token when I have obtained authorization code.

below the code extract :

def callback():
“”" This is where the user comes after he logged in SSO “”"
# get the code from the login process
#redirect_uri, scopes, token = extract_state_token(request.args.get(‘state’))
code = request.args.get(‘code’)
token = request.args.get(‘state’)
# compare the state with the saved token for CSRF check
sess_token = session.pop(‘token’, None)
if sess_token is None or token is None or token != sess_token:
return ‘Login EVE Online SSO failed: Session Token Mismatch’, 403
# now we try to get tokens
auth_response = esisecurity.auth(code)
except APIException as e:
return ’ je suis là : Login EVE Online SSO failed: %s’ % e, 403

The error is coming in the last exception when I call :
auth_response = esisecurity.auth(code)

Thanks in advance for your help


It is possible that if you are using EsiPy out of the box it may not be completely compatible with current SSO.
There have been some changes recently, I do not use it all the time so am not completely up to date. But EsiPy has not been updated since August 2020 it looks.

Go through your code process and compare to ESI Step by Step - SSO to Authenticated Calls - EVE: Developers to make sure everything you are doing is up to spec.

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