These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Noob problem with SSO - authorization code not found

Author
Mysho Agalder
Pator Tech School
Minmatar Republic
#1 - 2017-02-21 13:17:26 UTC  |  Edited by: Mysho Agalder
I'm probably doing something really stupid, but I have read the docs here and don't know what I'm doing wrong: http://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/authentication.html
I'm trying to use Esipy: https://github.com/Kyria/EsiPy/blob/master/docs/auth.md
I have an app registered, and callback configure, and everything, and I'm trying to do the SSO authorization code flow manually.

First, I obtain the auth uri:

security = EsiSecurity(app=app, redirect_uri='https://evetooling.com/login/complete', client_id='8d3f99624d424d52be8e89838c32fd2d', secret_key='reallysecret')
security.get_auth_uri()

#returns  'https://login.eveonline.com/oauth/authorize?response_type=code&redirect_uri=https%3A%2F%2Fevetooling.com%2Flogin%2Fcomplete&client_id=8d3f99624d424d52be8e89838c32fd2d'


I open that link in my browser, and after login screen I get redirected to something like:
https://evetooling.com/login/complete?code=GHcNuSnb3pFbY9SVi39HUsvZfZw7bFCdkDMXSciMU5MXKuNvAhuSxJu494RF529F0

Now I take that code and copy it here:
curl -H 'Authorization: Basic bm90IGdvbm5hIGdpdmUgeW91IG15IHNlY3JldA==' -X POST --data-urlencode "grant_type=authorization_code" --data-urlencode "code=GHcNuSnb3pFbY9SVi39HUsvZfZw7bFCdkDMXSciMU5MXKuNvAhuSxJu494RF529F0" https://login.eveonline.com/oauth/token

I always get error 400:
{"error":"invalid_request","error_description":"Authorization code not found"}

Any ideas on what might be wrong?

Edit:
Solved by creating a new app on developers page - for some reason my old app credentials are invalid for current SSO
Althalus Stenory
Flying Blacksmiths
#2 - 2017-02-22 12:20:43 UTC  |  Edited by: Althalus Stenory
wondering, since you use EsiPy, why don't you just do this to get the token
security.auth(code)

(or maybe your curl was just to test the values to see why you had that issue)

EsiPy - Python 2.7 / 3.3+ Swagger Client based on pyswagger for ESI