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:----fhKSeBVqGPIjRsHnGkG2hnvoA8SZbBDs5w/CiV7xQQv56Yg/BnnbsBG+iQ7+tM1SWYT4ocIytzHGPO8TXAOiPoZa6T45f9H/d+zG6Gk38vcS8fVZtmKyNtbbqA+/lncRmRzE8JSDOnakfK5HbnTpsHX+bwoyIOcJO2e6aUrzkkWvBYFm8vAgQS73WElVdKi5yZP7/Rq6EHaw4XT0l3Eka0rha9Xsky/TeIAsjAe3oH9bM9R5saGneESsSMC515b33o+zw0KiUerYZGnhQakIhXPkePeRLTILPLyBCsyicoAdeJ7ukmYGnvGE9KllfpDmTUDssc9sN3WGr4CzhUSJZIo9pQTXPhtF5dNmFzMEhKbKqHPgHkWaLEU/FD8+st7POCjnRMgx/1nXtenPGWI4g016ofZvTumH2n2bXOBbDw0qGIj2LgL81Y6A1F9LjS+FVWtGJMfWmrkimw1F6A4c/bzLxRb0rhsGsTvzIiGiytM6JX8go2Z9n+N5HF1TQnTnHUS/VS+zGoYzZYEfDMADXuZupU10qO8qvRmvSHqTqUtx2kMbCA6PzySm+bHKsCR/YeC7IU8BD2+CgR5NJiWCQ4x4uTfSQTjaC+BvPGHhiRtD4DEHpj4YWmURHCevVhDrMcJ/hsiv3I78pDWK3rYJ9Sgi/WxHxqE4rKcL2R2zPEQ=----ATTACHMENT:----MTIwODcxNjA0NDA5MDkyNSAzMTI0NjM3MzM0NDEzNzU4IDU2MzY3MjA5NTE5MjkwNjk=