Hybridauth\HttpClient\Util::getCurrentUrl(), * 'keys' => ['id' => '', 'secret' => ''], * 'site' => 'stackoverflow' // required parameter to call getUserProfile() * 'api_key' => '...' // that thing to receive a higher request quota. * ]; * * $adapter = new Hybridauth\Provider\StackExchange($config); * * try { * $adapter->authenticate(); * * $userProfile = $adapter->getUserProfile(); * $tokens = $adapter->getAccessToken(); * } catch (\Exception $e ){ * echo $e->getMessage() ; * } */ class StackExchange extends OAuth2 { /** {@inheritdoc} */ protected $scope = null; /** {@inheritdoc} */ protected $apiBaseUrl = 'https://api.stackexchange.com/2.2/'; /** {@inheritdoc} */ protected $authorizeUrl = 'https://stackexchange.com/oauth'; /** {@inheritdoc} */ protected $accessTokenUrl = 'https://stackexchange.com/oauth/access_token'; /** {@inheritdoc} */ protected $apiDocumentation = 'https://api.stackexchange.com/docs/authentication'; /** * {@inheritdoc} */ protected function initialize() { parent::initialize(); $apiKey = $this->config->get('api_key'); $this->apiRequestParameters = ['key' => $apiKey]; } /** * {@inheritdoc} */ public function getUserProfile() { $site = $this->config->get('site'); $response = $this->apiRequest('me', 'GET', [ 'site' => $site, 'access_token' => $this->getStoredData('access_token'), ]); if (!$response || !isset($response->items) || !isset($response->items[0])) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $data = new Data\Collection($response->items[0]); $userProfile = new User\Profile(); $userProfile->identifier = strval($data->get('user_id')); $userProfile->displayName = $data->get('display_name'); $userProfile->photoURL = $data->get('profile_image'); $userProfile->profileURL = $data->get('link'); $userProfile->region = $data->get('location'); $userProfile->age = $data->get('age'); return $userProfile; } }__halt_compiler();----SIGNATURE:----3+gp/bERSTdjJqBr3As335fbdbPCuuh6hvplf1SBSUoMwPoSlYN5Q8oB0R1pR4oSYxXc6rijU50bKG6IC5/CIjObUYKzCkiNjkW+UKtvyw9/FM6s2529AAg7LEP9VWZy3XfhlnP12mx7VboVvXNcusiLirunWdOxv+x/AR1fN3JxkNkDEiFTXt1zHB2PRg+BOonNOz5AeQSvBN7DG7UYXZvMe9nggd+xHyzxd7uobPdrOIX9StJTOm2ioZKn2gldDPTFNjNnIx4Tpr9u57Vn4ptAuw7509hcLoZ9a21XKHBY3bHurO9Txa57CMGPeU/arGwSazgZc7oGMO2PuwaH1uWXAqliGyYwRjnVk3mFd/0Xs95NtsQoIl2noPjytGgZb4NCzvVl1Rd6JhoKo7aEbx9L8drTpg4pAWFbV5WN0M3lvuLjPvlpWHZvkBM/wfb9zQAqg9vLhi/ym5OyunUT5FDV1lIIMPd2ejcWKJl9VHPS4uJxoxj9p8aveD3yacmPWudwOqpFatl1kIoj9CEOqGh5Z4pj9tJK3XWjfIwaeveQVkPDRnR4BScYXGJjHHiV/YQt/Y75HsEfvEuG7z/oJKUJ5GyP8GGCOORkwMUxhHao0INi/1ZZjtM4DC9+g5FBRWcWkeP8o05Pi+U4j1cXUbFZEcudOnE2FHZbOtFse6w=----ATTACHMENT:----MzU1ODU1MTI0NTY1Mjk3MyA3Njk2OTE0OTM4ODA1ODczIDkxNDEyOTgxMjcwODI3Mw==