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.
Previous page12
 

Symfony HWI OAuthBundle for Eve SSO

First post First post
Author
Will Morrisson
Podpilots Management Corporation
#21 - 2015-01-12 23:33:24 UTC
Tahnil wrote:

There is the access token, token type, expires in, and the refresh token. So everything is there. Only question remains: how to access this data. Any ideas anybody? My googling has been unsuccessful so far. I only found out how to get the other Session attributes such as id (of user in my user table), nickname (Tahnil), and realname (Tahnil, too).



You surely defined a custom User Provider with a method named « loadUserByOAuthUserResponse ».
This method receive an object implementing ResponseInterface which has a method getResponse returning an array with all data given by Eve SSO response.
Tahnil
Gunboat Commando
#22 - 2015-01-13 20:53:13 UTC
Thanks for your response. You are right. But I think it‘s not an array. Instead I think it might be some serialized or deserialized "object" (or whatever). It‘s not json, it‘s not a php array. It looks like this:

C:68:"HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\OAuthToken":599:{a:7:{i:0;s:87:"pq…some_token…3g2";i:1;a:4:{s:12:"access_token";s:87:"pq…some_token…3g2";s:10:"token_type";s:6:"Bearer";s:10:"expires_in";i:300;s:13:"refresh_token";N;}i:2;N;i:3;i:300;i:4;i:1421180242;i:5;s:10:"eve_online";i:6;s:223:"a:4:{i:0;C:32:"Some\EverelatedBundle\Entity\User":12:{a:1:{i:0;N;}}i:1;b:0;i:2;a:1:{i:0;O:41:"Symfony\Component\Security\Core\Role\Role":1:{s:47:"Symfony\Component\Security\Core\Role\Rolerole";s:9:"ROLE_USER";}}i:3;a:0:{}}";}}


Never seen this data format before. I‘m getting the impression that Symfony might be a little too sophisticated for me… This is frikkin‘ hard Lol
Tahnil
Gunboat Commando
#23 - 2015-01-13 21:17:58 UTC
OMG. I think I found the information that I was missing.

Quote:
What is the importance of serialize and unserialize?

The Serializable interface and its serialize and unserialize methods have been added to allow the User class to be serialized to the session. This may or may not be needed depending on your setup, but it's probably a good idea. The id is the most important value that needs to be serialized because the refreshUser() method reloads the user on each request by using the id. In practice, this means that the User object is reloaded from the database on each request using the id from the serialized object. This makes sure all of the User's data is fresh.

http://symfony.com/doc/current/cookbook/security/entity_provider.html
Previous page12