芝麻web文件管理V1.00
编辑当前文件:/home/digitalh/network.digitalhubbd.com/fns/hybridauth/Provider/Reddit.php
AuthorizeUrlParameters += [ 'duration' => 'permanent' ]; $this->tokenExchangeParameters = [ 'client_id' => $this->clientId, 'grant_type' => 'authorization_code', 'redirect_uri' => $this->callback ]; $this->tokenExchangeHeaders = [ 'Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret) ]; $this->tokenRefreshHeaders = $this->tokenExchangeHeaders; } /** * {@inheritdoc} */ public function getUserProfile() { $response = $this->apiRequest('me.json'); $data = new Data\Collection($response); if (!$data->exists('id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('id'); $userProfile->displayName = $data->get('name'); $userProfile->profileURL = 'https://www.reddit.com/user/' . $data->get('name') . '/'; $userProfile->photoURL = $data->get('icon_img'); return $userProfile; } }