Answer the question
In order to leave comments, you need to log in
How to set up SSO authorization on the site?
Good day!
I play EVE online and I want to make one of the sites the possibility of authorization via SSO.
This process is in the article:
https://eveonline-third-party-documentation.readth...
I managed to create an application and make a link that will redirect the user to authorization, and then return him to my site with a unique identifier code.
Now my task, as written in the instructions, is to make a POST request, https://login.eveonline.com/oauth/token to exchange the authorization code for an access token.
And here is a complete stupor. Having no programming skills, I don’t even understand what exactly is required of me.
Those. You can make a POST request, for example, via curl.
I'm trying the following code:
<?php
$encoded = base64_encode($string='<b>bla</b>:<b>blablabla'</b>);
$request_headers = array('Authorization' => 'Basic ' . $encoded, 'Content-Type' => 'application/x-www-form-urlencoded', 'Host' => 'login.eveonline.com');
$code = $_GET['code'];
$postfieldStr = array('grant_type' => 'authorization_code', 'code' => $code);
$ch = curl_init('https://login.eveonline.com/oauth/token');
curl_setopt($ch, CURLOPT_HTTPHEADER, $request_headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfieldStr);
$out = curl_exec($ch);
curl_close($ch);
print_r($out);
?>
Answer the question
In order to leave comments, you need to log in
In general, we managed to find the finished code on github.
The question is over.
EVE Online uses the OAuth2: Authorization Code Grant as they state at the start of the documentation.
Accordingly, to understand what, where and why to send, you can read the OAuth2 documentation - authorization through code, for example, an explanation from DigitalOcean
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question