{"action":"created","issue":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/237","labels_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/237/comments","events_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/237/events","html_url":"https://github.com/thephpleague/oauth2-client/issues/237","id":61002613,"number":237,"title":"User Entity cannot be set","user":{"login":"marcojanssen","id":2293642,"avatar_url":"https://avatars.githubusercontent.com/u/2293642?v=3","gravatar_id":"","url":"https://api.github.com/users/marcojanssen","html_url":"https://github.com/marcojanssen","followers_url":"https://api.github.com/users/marcojanssen/followers","following_url":"https://api.github.com/users/marcojanssen/following{/other_user}","gists_url":"https://api.github.com/users/marcojanssen/gists{/gist_id}","starred_url":"https://api.github.com/users/marcojanssen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcojanssen/subscriptions","organizations_url":"https://api.github.com/users/marcojanssen/orgs","repos_url":"https://api.github.com/users/marcojanssen/repos","events_url":"https://api.github.com/users/marcojanssen/events{/privacy}","received_events_url":"https://api.github.com/users/marcojanssen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/milestones/1","html_url":"https://github.com/thephpleague/oauth2-client/milestones/v1.0","labels_url":"https://api.github.com/repos/thephpleague/oauth2-client/milestones/1/labels","id":724139,"number":1,"title":"v1.0","description":"","creator":{"login":"alexbilbie","id":77991,"avatar_url":"https://avatars.githubusercontent.com/u/77991?v=3","gravatar_id":"","url":"https://api.github.com/users/alexbilbie","html_url":"https://github.com/alexbilbie","followers_url":"https://api.github.com/users/alexbilbie/followers","following_url":"https://api.github.com/users/alexbilbie/following{/other_user}","gists_url":"https://api.github.com/users/alexbilbie/gists{/gist_id}","starred_url":"https://api.github.com/users/alexbilbie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexbilbie/subscriptions","organizations_url":"https://api.github.com/users/alexbilbie/orgs","repos_url":"https://api.github.com/users/alexbilbie/repos","events_url":"https://api.github.com/users/alexbilbie/events{/privacy}","received_events_url":"https://api.github.com/users/alexbilbie/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":7,"state":"open","created_at":"2014-07-17T11:46:55Z","updated_at":"2015-03-26T22:39:08Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2015-03-13T07:18:21Z","updated_at":"2015-04-10T03:37:17Z","closed_at":null,"body":"The User Entity for all the providers are tightly coupled and have no way to be injected or set when retrieving the user details. The only way now is to inherit the provider in our own concrete and override the method, which is not something i prefer.\r\n\r\n```\r\npublic function userDetails($response, AccessToken $token)\r\n    {\r\n        $user = new User();\r\n\r\n        $email = (isset($response->emailAddress)) ? $response->emailAddress : null;\r\n        $location = (isset($response->location->name)) ? $response->location->name : null;\r\n        $description = (isset($response->headline)) ? $response->headline : null;\r\n        $pictureUrl = (isset($response->pictureUrl)) ? $response->pictureUrl : null;\r\n\r\n        $user->exchangeArray([\r\n            'uid' => $response->id,\r\n            'name' => $response->firstName.' '.$response->lastName,\r\n            'firstname' => $response->firstName,\r\n            'lastname' => $response->lastName,\r\n            'email' => $email,\r\n            'location' => $location,\r\n            'description' => $description,\r\n            'imageurl' => $pictureUrl,\r\n            'urls' => $response->publicProfileUrl,\r\n        ]);\r\n\r\n        return $user;\r\n    }\r\n```\r\n\r\nIn case of LinkedIn there are more user details we can extract when a r_fullprofile scope is provided.  Are there plans to implement this and if not what are your thoughts about how to implement it? We could add it in the abstract provider but i prefer a seperate object for it.\r\n\r\nWill free up some time, if needed, to implement it.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/comments/91418695","html_url":"https://github.com/thephpleague/oauth2-client/issues/237#issuecomment-91418695","issue_url":"https://api.github.com/repos/thephpleague/oauth2-client/issues/237","id":91418695,"user":{"login":"GawainLynch","id":1427081,"avatar_url":"https://avatars.githubusercontent.com/u/1427081?v=3","gravatar_id":"","url":"https://api.github.com/users/GawainLynch","html_url":"https://github.com/GawainLynch","followers_url":"https://api.github.com/users/GawainLynch/followers","following_url":"https://api.github.com/users/GawainLynch/following{/other_user}","gists_url":"https://api.github.com/users/GawainLynch/gists{/gist_id}","starred_url":"https://api.github.com/users/GawainLynch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GawainLynch/subscriptions","organizations_url":"https://api.github.com/users/GawainLynch/orgs","repos_url":"https://api.github.com/users/GawainLynch/repos","events_url":"https://api.github.com/users/GawainLynch/events{/privacy}","received_events_url":"https://api.github.com/users/GawainLynch/received_events","type":"User","site_admin":false},"created_at":"2015-04-10T03:37:17Z","updated_at":"2015-04-10T03:37:17Z","body":"Awesome stuff @kevindierkx"}}