芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/network.digitalhubbd.com/fns/hybridauth/Provider/Authentiq.php
AuthorizeUrlParameters += [ 'prompt' => 'consent' ]; $this->tokenExchangeHeaders = [ 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) ]; $this->tokenRefreshHeaders = [ 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) ]; } /** * {@inheritdoc} */ public function getUserProfile() { $response = $this->apiRequest('userinfo'); $data = new Data\Collection($response); if (!$data->exists('sub')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('sub'); $userProfile->displayName = $data->get('name'); $userProfile->firstName = $data->get('given_name'); // $userProfile->middleName = $data->get('middle_name'); // not supported $userProfile->lastName = $data->get('family_name'); if (!empty($userProfile->displayName)) { $userProfile->displayName = join(' ', array($userProfile->firstName, // $userProfile->middleName, $userProfile->lastName)); } $userProfile->email = $data->get('email'); $userProfile->emailVerified = $data->get('email_verified') ? $userProfile->email : ''; $userProfile->phone = $data->get('phone'); // $userProfile->phoneVerified = $data->get('phone_verified') ? $userProfile->phone : ''; // not supported $userProfile->profileURL = $data->get('profile'); $userProfile->webSiteURL = $data->get('website'); $userProfile->photoURL = $data->get('picture'); $userProfile->gender = $data->get('gender'); $userProfile->address = $data->filter('address')->get('street_address'); $userProfile->city = $data->filter('address')->get('locality'); $userProfile->country = $data->filter('address')->get('country'); $userProfile->region = $data->filter('address')->get('region'); $userProfile->zip = $data->filter('address')->get('postal_code'); return $userProfile; } }