Pages: [1] :: one page |
|
Author |
Thread Statistics | Show CCP posts - 0 post(s) |
Ethan02
Succurit Research and Development
2
|
Posted - 2016.11.17 12:31:38 -
[1] - Quote
Hello knowledgable people,
I'm completely blank on the topic of SSO/OAuth, but now with some interesting endpoints on ESI that require auth, I need to get my head around it, if I can pull that data into my local database for further mangling.
While reading and searching I haven't been able to clearly answer the main question relevant to me:
Is it possible to query a ESI endpoint like "/universe/structures/{structure_id}/" that requires auth in a cron script? Meaning non-interactively, by supplying the needed authentication data as parameters. Yes or no?
If yes, if you know any documentation or implementations of this, they would be highly appreciated aswell.
Thank you, Ethan02
Adam4EVE - Just another market tool and graph porn generator
|
Muscaat
EVE Markets
67
|
Posted - 2016.11.17 12:40:14 -
[2] - Quote
It's possible if you do a little work beforehand. If you step through the auth process manually to the point where you have a client ID, secret and the refresh key from an authenticated character, those are the three components you need to be able to obtain a fresh access token each time and use it in your requests.
So something like
- Set up a new account at http://developers.eveonline.com and note its client ID and secret. Use a URL like http://localhost/callback as the callback URL.
- Construct yourself the auth URL, and go to it in a browser. You'll end up redirected to http://localhost/callback (which won't exist and will give you an error) but in the URL will be the authorization code you need for the next step.
- Verify the authorization code. Make a note of the refresh token.
Then in your cron script you'll want to
- Use the client ID, secret and refresh token from earlier to get a fresh access token
- Use the access token in your ESI request.
https://eveonline-third-party-documentation.readthedocs.io/en/latest/sso/index.html is useful for reference!
(This all assumes you just want some access using your own EVE account, and you're not trying to create something for public use.) |
Ethan02
Succurit Research and Development
2
|
Posted - 2016.11.17 12:45:44 -
[3] - Quote
Excellent answer, thanks. Will fiddle with that.
Adam4EVE - Just another market tool and graph porn generator
|
March rabbit
Mosquito Squadron The-Culture
1944
|
Posted - 2016.11.18 13:06:19 -
[4] - Quote
Hi! After trying for few days i'm stuck on step 3 (verifying auth code).
Response to my POST:
Quote:{"error":"invalid_client","error_description":"Unknown client"}
instruction gives pretty straightforward procedure.
I've constructed HTTP address and used it in browser. Got authorization window and stuff (it means i got clientID correctly doesn't it?), error while redirecting and needed address in address bar.
Grabbing authorization code from it and posting with
curl -v -X POST --header "Authorization: Basic NzY1N...gxbwo=" --header "Host: login.eveonline.com" --header "Content-Type: application/x-www-form-urlencoded" --data "authorization_code&code=vDrg...jn7ta0" https://login.eveonline.com/oauth/token
... And then: quoted early response.
I've rechecked client ID (this is alpha-numerical code and not name of application?), secret ID, base64 encoding/decoding. Anything seems ok but....
Any ideas what's going wrong here?
Thanks beforehand
The Mittani: "the inappropriate drunked joke"
|
David Davaham
12
|
Posted - 2016.11.19 04:01:40 -
[5] - Quote
March rabbit wrote:Grabbing authorization code from it and posting with curl -v -X POST --header "Authorization: Basic NzY1N...gxbwo=" --header "Host: login.eveonline.com" --header "Content-Type: application/x-www-form-urlencoded" --data "authorization_code&code=vDrg...jn7ta0" https://login.eveonline.com/oauth/token
This part right here
--data "authorization_code&code=vDrg...jn7ta0"
It is suppose to be
--data "grant_type=authorization_code&code=vDrg...jn7ta0"
|
March rabbit
Mosquito Squadron The-Culture
1945
|
Posted - 2016.11.19 09:39:00 -
[6] - Quote
Thanks. But the problem persists.
I believe it is something with Basic Authorization. Maybe it needs to be done another way?
I've made a string client ID:secret key and piped it to Linux utility base64. Feeding result to 'base64 -d' i get original string so it is not encoding itself. But maybe i messed something with data? It would be great to see the whole request which is generated and Sent by sURL
The Mittani: "the inappropriate drunked joke"
|
YeuxVerts Belle
Viziam Amarr Empire
15
|
Posted - 2016.11.23 06:17:04 -
[7] - Quote
Bumping the thread, as my question seems relevant.
I'm still used to the XML API keys. With CREST and ESI, is this SSO protocol the only way to get access to authenticated endpoints ? It seems overly complicated for what i have in mind, which is fairly close to the original poster's wish.
The above message presents my opinions on the topic at hand. If there is a conflict between my views and reality, consider reality to be correct until proven otherwise.
|
March rabbit
Mosquito Squadron The-Culture
1951
|
Posted - 2016.11.23 06:25:04 -
[8] - Quote
YeuxVerts Belle wrote:Bumping the thread, as my question seems relevant.
I'm still used to the XML API keys. With CREST and ESI, is this SSO protocol the only way to get access to authenticated endpoints ? It looks like it is.
YeuxVerts Belle wrote: It seems overly complicated for what i have in mind, which is fairly close to the original poster's wish. You can get around SSO 'all the time' by doing some steps only once for your project (logging -> getting auth code -> getting refresh token).
The Mittani: "the inappropriate drunked joke"
|
YeuxVerts Belle
Viziam Amarr Empire
15
|
Posted - 2016.11.23 06:36:17 -
[9] - Quote
Alright, thanks.
The above message presents my opinions on the topic at hand. If there is a conflict between my views and reality, consider reality to be correct until proven otherwise.
|
|
|
|
Pages: [1] :: one page |
First page | Previous page | Next page | Last page |