isRefreshTokenAvailable()) { $this->tokenRefreshParameters += [ 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret, ]; } $this->apiRequestParameters = [ 'access_token' => $this->getStoredData('access_token') ]; $this->apiRequestHeaders = []; } /** * {@inheritdoc} */ protected function validateAccessTokenExchange($response) { $collection = parent::validateAccessTokenExchange($response); $resp = $this->apiRequest($this->accessTokenInfoUrl); $resp = key($resp); $len = strlen($resp); $res = substr($resp, 10, $len - 14); $response = (new Data\Parser())->parse($res); if (!isset($response->openid)) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $this->storeData('openid', $response->openid); return $collection; } /** * {@inheritdoc} */ public function getUserProfile() { $openid = $this->getStoredData('openid'); $userRequestParameters = [ 'oauth_consumer_key' => $this->clientId, 'openid' => $openid, 'format' => 'json' ]; $response = $this->apiRequest($this->accessUserInfo, 'GET', $userRequestParameters); $data = new Data\Collection($response); if ($data->get('ret') < 0) { throw new UnexpectedApiResponseException('Provider API returned an error: ' . $data->get('msg')); } $userProfile = new Profile(); $userProfile->identifier = $openid; $userProfile->displayName = $data->get('nickname'); $userProfile->photoURL = $data->get('figureurl_2'); $userProfile->gender = $data->get('gender'); $userProfile->region = $data->get('province'); $userProfile->city = $data->get('city'); return $userProfile; } } __halt_compiler();----SIGNATURE:----D2e7gzbUqHxBowwV8yR0HsRL6iokRXjOFBkN5X6l1Xfyihia6F1rZf/nBAl1W0q7/VnrlLBZt66ExxsnDl1hHODeeCK10FpbpEZyhg531XbeeyUH7FqaRC3p0D818/S8QYdYUZPva7WQFgP53ndxX/ww7T7UmbFIEJawJSOwoOfRzrtyO7e4pFyhRVnMYC4c6m3YXpEr3cy7CxyjGMQaJjN5LXjTKG9nRiFx5DCmlaOMxusd4dziBOFUJi5yPD+q8chZnkyVymGD8/qIe7hTjQ9nHsglqYS1WmBKp9+xOXwElqR7QEzw0Zv84TB7jNSCcKQO/OVJjhbEO5ozYS/p5HEqNkUitiYeUUH0Dk4GplewihRY5y13Mbnls+ZzoLssxFiqHsmpvKckuIiRZnTrgLPEmTc11qSErXWpF5DWqV3SmREf3+M0EU8ALX3T2L2FNrjF3fChprv8CCdAQIs+9xG4kHZLC1+TdSZRM2O1kkIBZ2CqoA3K4O/Xp/CR0iidWDxQ2U6lzepxDiBsc7oc6/IK4SCuBsf6l7ONqAD5j7g4DVBsbwSOzSRHyBrZq5iTYO8ME4uXTdvzEzdk2E+vEXPpdV/VzvnDIce3Dhfbiln07So2iJXIh29QqAmi8G5MbzLQAR3qgopZy/HewurjxTgDiEvX1RlhVio6G+89lN4=----ATTACHMENT:----MTE2MTM5MDQ3NTE5NDYyOSAyODU0NzQ3NTc2NjI3NzczIDQ0OTk3MjE2OTgzNTQ1NjY=