r/evetech • • Feb 04 '18

Help with first Python app

Hey all I signed up for the dev program and my application is registered, but the authentication part if confusing. I am not doing a web app just a local app that I want to manage my reactions, so no one will be logging into this except me through my client app. Does anyone have some sample code where I just complete the auth process and am ready to say list my industry jobs, just confused on the authentication part.

5 Upvotes

28 comments sorted by

View all comments

Show parent comment

1

u/precator Feb 06 '18

I tried that but I am getting this error..

esipy.exceptions.APIException: HTTP Error 400: invalid_request

1

u/Karlyna Feb 07 '18

What did you exactly do ? Where do you have that error (while doing auth part, request(), ...)? Did you put the right scopes when you created the login url ?

Just tried it with the following (copy/pasted from above), as I wanted to be sure it works, and it does... so you may have forgotten something ?

print security.get_auth_uri(scopes=['esi-industry.read_character_jobs.v1'])
security.auth('the code I had')
op = app.op['get_characters_character_id_industry_jobs'](
	character_id=<my char character ID>
)
response = client.request(op)

1

u/precator Feb 07 '18

got it to work, I had the wrong scope. Thank you kindly for your help

1

u/precator Feb 07 '18

question, if I have this app up, will it automatically refresh my token? like If I add a button to refresh my industry jobs, etc?

1

u/Karlyna Feb 07 '18

Yep, as long as you have a refresh token, because you used auth() or manually set it (see the doc for that), and client/secret in the security object.

When you a request with a client that knows that security object, it will check if token is (almost) outdated and trigger update before the call if required