Open userbig opened 4 years ago
Hi,
This is caused by the missing access token in your authentication container. If you add a valid SSO2 token in it, it should pass.
If such so you probably need to fix guidelines https://github.com/eveseat/eseye/wiki/Eseye-Simple-Tutorial
That would assume the old case is non longer valid. I'm not sure of the state yet.
However, can you confirm it is working properly if you provide the token ?
I'm also having this issue. I can confirm I passed the access code into the authorization container and it still failed.
Downgrading to version 2.0.0 and deleting the old file cache also fixed the problem for me (and using the same code).
do you have a sample of your used code ?
the $character value is where I pull the information from the database and push it to the container.
$character = EveIndustry::GetCharacter();
$authentication = new EsiAuthentication(array(
'client_id' => EVE_CLIENT_ID,
'secret' => EVE_SECRET_KEY,
'access_token' => $character->accessToken,
'refresh_token' => $character->refreshToken,
'token_expires' => date('Y-m-d H:i:s', $character->tokenEOL)
));
$esi->setAuthentication($authentication);
$employment = $esi->invoke('get', '/characters/{character_id}/blueprints/', [
'character_id' => $character->CharacterID
]);
Are you using SSO v2 token ? or is it SSO v1 format ? SSO v1 token will not work with 2.2.0 or greater since eseye is using JWT format.
Pretty sure I'm using SSO v2, although I'm using a different library for authenticating the characters and the scopes so I could be wrong.
I couldn't find a way to use Eseye to get the initial access token and refresh token from the authentication code. Am I missing something somewhere?
You can use this portal to decode a token https://jwt.io/ If it's a v2, it must be built in three part and contain scope list
It seems my tokens are not in JWT format, which would explain a big part of the issue. Not sure where to go from here.
That's from CCP docs : https://github.com/esi/esi-docs/blob/master/docs/sso/web_based_sso_flow.md https://github.com/esi/esi-docs/blob/master/docs/sso/validating_eve_jwt.md
Here is the way we've implemented it in SeAT : https://github.com/eveseat/services/tree/4.0.x/src/Socialite/EveOnline
Also, either you make the switch from SSO v2.0 or if you stick to SSO v1.0, you have to target eseye 2.0.*
Thanks for the help, when tried targeting the SSO v2 I get different a grant type not supported error, but I'll try the links you sent. If it doesn't work I will either post on the Eve forums or open a different issue so this one doesn't get any more cluttered.
Thanks for the help, when tried targeting the SSO v2 I get different a grant type not supported error, but I'll try the links you sent. If it doesn't work I will either post on the Eve forums or open a different issue so this one doesn't get any more cluttered.
use https://github.com/nullx27-org/eveonline-socialite and replace in EveOnlineSocialiteProvider.php https://login.eveonline.com/oauth/authorize to https://login.eveonline.com/v2/oauth/authorize & https://login.eveonline.com/oauth/token to https://login.eveonline.com/v2/oauth/token i try. all ok!
I am having the same issue as OP originally stated, but had trouble following the final solution to get it working again.
InvalidArgumentException Unsupported input
Jose\Component\Signature\Serializer\CompactSerializer::unserialize vendor/web-token/jwt-signature/Serializer/CompactSerializer.php :72
@awingender are you providing an access token ? do you have any code sample to get a bit of context ?
I am new to Eseye and am still trying to get the example to work.
Edit: I used Token Generator to make the access token.
Edit 2: I downgraded to 2.0.0 like others, and Eseye works now. This time, I did not put an access token anywhere. Just the refresh key. I am very much interested in knowing what I was doing wrong, and am willing to help.
<?php
// Eseye - Simple Tutorial
include 'vendor/autoload.php';
$client_id = 'ea2e784a44dxxxxxxxxxxb1dd9615451';
$secret_key = 'yNoSs8C2Mwc9vxxxxxxxxxxBNtqxeY7xxxxxPdjW';
$refresh_token = 'sLcwsxxxxxHDDizQa16H7STgGmUBQS5cE7g4hPzKdXDKZJ-BjWWolfyPxY9v9bCyf8lRSiSe_FV0UwIPeZ11y6RoyYfuCOVjEVk9BGEtEcFsy5cZidluXXh9xxxxx6M4Zt-5ApQGu0xxxxxbTpH8dZ5njufnrlmzbh3xxxxx1NPcsELT_gexJSCuBdoDydj32yNXkPH_nRHXYa0Z2YpSeqiCB5h4ALoxxKPDVOd1KJwsGI8NPFGfZ0g-ITGGpSRiUgy4H-XB8JIAaO_GbTjqLWB0b_pzxmM8d0mxxxxxWcLruGqHnQ_p2pZfxChu9au41_z-f1ClL9pLKNYXw2Vv2hrZ6JQfmO1NzMR9THIv0mJ2dgy1XdCoTgZmiEVh9DgC_wDwpeOnrob-eo09V0wBDQ';
$authentication = new \Seat\Eseye\Containers\EsiAuthentication([
'client_id' => $client_id,
'secret' => $secret_key,
'refresh_token' => $refresh_token,
]);
$esi = new \Seat\Eseye\Eseye($authentication);
$character_info = $esi->invoke('get', '/characters/{character_id}/', [
'character_id' => 1477911111,
]);
echo $character_info->name;
Here is where I put my access token... inside EsiAuthentication.php
namespace Seat\Eseye\Containers;
use Seat\Eseye\Traits\ConstructsContainers;
use Seat\Eseye\Traits\ValidatesContainers;
/**
* Class EsiAuthentication.
* @package Seat\Eseye\Containers
*/
class EsiAuthentication extends AbstractArrayAccess
{
use ConstructsContainers, ValidatesContainers;
/**
* @var array
*/
protected $data = [
'client_id' => null,
'secret' => null,
'access_token' => '1|CfDJ8Hj9X4L/huFJpslTkv3swZP7cpJlIx8+Cyi6FCu8sl7/0lJ5GifCbEm+yuKbIt7yEMkwUZZImojFVeI+Qaw7/LZVqCxxxxx9JILt1uI79ih4c+DGzRS1oxLvi+Ox+2ESIEzpLQxxxxxMUPthjnDjO7nmdxxxxxTZbGOaqqVDGbLU',
'refresh_token' => null,
'token_expires' => '1970-01-01 00:00:00',
'scopes' => [],
];
public function setRefreshToken(string $refreshToken): self
{
$this->data['refresh_token'] = $refreshToken;
return $this;
}
}
Here is my output:
@awingender thank you to pointing the toolbox
new version is shipped with a toolbox compatible with JWT tokens / OAuth v2 endpoints
Has somebody of you a working fork with the "2.0" downgrade applied?
I believe there is a bug in GuzzleFetcher.php in setAuthenticationScopes() - it takes access token from authentication container, when it should just call getToken(). Currently, access_token needs to be explicitly set and it also needs to be valid, otherwise JWT validation goes boom, which kinna defeats the purpose of token autorefreshment.
Changing
$jws_token = $this->verifyToken($this->authentication->access_token);
to
$jws_token = $this->verifyToken($this->getToken());
seems to be working for me (at least for now:-) ).
This is still an issue 2 years later.
Following the instructions, it says nothing about having to provide the access_token, so I get exact same error as OP.
Manuals and Wiki should be update to clarify exactly what is needed.
Now, after adding the extra/missing data I get an error because the token has expired, so for some reason is not even trying to refresh the access_token.
I just have another fresh installment of eseye on my laravel app and I get some error
InvalidArgumentException
Unsupported input
Jose\Component\Signature\Serializer\CompactSerializer::unserialize vendor/web-token/jwt-signature/Serializer/CompactSerializer.php :72
https://flareapp.io/share/o7AeeB7p#F50
lib version 2.2.1
upd: after downgrading to 2.0.0 everything is fine.