Load refresh token details by token

@param   string  $refresh_token  Refresh token
@return  array   Refresh token details
13557
public function getRefreshToken($refresh_token)
	{
		// create refresh token
		$token = \Components\Developer\Models\Refreshtoken::oneByToken($refresh_token);

		// make sure we have a token
		if (!$token->get('id'))
		{
			return false;
		}

		// make sure its a published token
		if (!$token->isPublished())
		{
			return false;
		}

		// get the application's client id
		$application = \Components\Developer\Models\Application::oneOrFail($token->get('application_id'));
		$token->set('client_id', $application->get('client_id'));

		// format expires to unix timestamp
		$token->set('expires', with(new Date($token->get('expires')))->toUnix());

		// return token
		return $token->toArray();
	}
503047
private function refreshAccessToken() {
        // Setup the params
        $params = [
            'client_id'     => $this->clientID,
            'client_secret' => $this->secret,
            'grant_type'    => 'refresh_token',
            'refresh_token' => $this->refreshToken
        ];

        // Parse the cURL result
        $this->parseAccessToken(CURL::post($this->url, $params));
    }
500760
public function refreshToken($refreshToken)
  {
    $this->refreshTokenRequest(
        array(
          'client_id' => $this->client->getClassConfig($this, 'client_id'),
          'client_secret' => $this->client->getClassConfig($this, 'client_secret'),
          'refresh_token' => $refreshToken,
          'grant_type' => 'refresh_token'
        )
    );
  }
1309663
protected function getRefreshToken($refreshToken)
    {
        if (null === $token = $this->app['repo.api-oauth-refresh-token']->find($refreshToken)) {
            return null;
        }

        return [
            'token'     => $token->getRefreshToken(),
            'expires'   => $token->getExpires(),
            'client_id' => $token->getAccount()->getApplication()->getClientId()
        ];
    }
399983
def refresh_token(token_service, refresh_token, client_id, client_secret):
  """"""
  data = {
    'client_id': client_id,
    'client_secret': client_secret,
    'refresh_token': refresh_token,
    'grant_type': 'refresh_token',
  }
  resp = requests.post(token_service, data)
  print resp, 'refreshing', resp.json()
  return resp.json()
1276944
public function getRefreshToken()
    {
        if (is_string($this->refresh_token) && $this->isValidToken() ){

            $this->refreshToken = $this->token_type . ' ' . $this->refresh_token;

            return $this->refreshToken;
        }

        return false;
    }
1108656
def delete_refresh_token(self, refresh_token):
        
        access_token = self.fetch_by_refresh_token(refresh_token)

        self.delete(access_token.token)
533483
public function refreshToken($refresh_token, array $client = [], $grant_type = 'refresh_token', $username = '', $scopes = [])
	{
		$request_data = [
			'client_id'     => $client['client_id'],
			'client_secret' => $client['client_secret'],
			'grant_type'    => $grant_type,
			'refresh_token' => $refresh_token,
		];

		if (! empty($scopes)) {
			$request_data['scope'] = implode(',', $scopes);
		}

		$response = $this->post($this->oauthUrl(), $request_data)->getJson();

		// If this was a successful auth, set the access token
		if (isset($response->access_token)) {
			$this->access_tokens[$username] = $response->access_token;
		}

		return $response;
	}
800844
public function requestAccessTokenRefresh($refreshToken)
    {
        $params = array(
            'refresh_token' => $refreshToken,
            'grant_type' => 'refresh_token',
            'scope' => $this->_getScope()
        );

        return $this->_makeRequest($this->_tokenEndPoint, $params);
    }
1316526
public function refreshAccessToken(TokenInterface $token)
    {
        $refreshToken = $token->getRefreshToken();

        if (empty($refreshToken)) {
            throw new MissingRefreshTokenException();
        }

        $parameters = [
            'grant_type'    => 'refresh_token',
            'type'          => 'web_server',
            'client_id'     => $this->credentials->getConsumerId(),
            'client_secret' => $this->credentials->getConsumerSecret(),
            'refresh_token' => $refreshToken,
        ];

        $responseBody = $this->httpRequest(
            $this->getAccessTokenEndpoint(),
            $parameters,
            $this->getExtraOAuthHeaders()
        );
        $token = $this->parseAccessTokenResponse($responseBody);
        $this->storage->storeAccessToken($this->service(), $token);

        return $token;
    }
732094
public function refreshAccessToken(OAuthToken $token)
    {
        $params = [
            'grant_type' => 'refresh_token'
        ];
        $params = array_merge($token->getParams(), $params);

        $request = $this->createRequest()
            ->setMethod('POST')
            ->setUrl($this->refreshTokenUrl)
            ->setData($params);

        $this->applyClientCredentialsToRequest($request);

        $response = $this->sendRequest($request);

        $token = $this->createToken(['params' => $response]);
        $this->setAccessToken($token);

        return $token;
    }
613841
public function refreshToken($token = null)
	{
		if (!$this->getOption('userefresh'))
		{
			throw new \RuntimeException('Refresh token is not supported for this OAuth instance.');
		}

		if (!$token)
		{
			$token = $this->getToken();

			if (!array_key_exists('refresh_token', $token))
			{
				throw new \RuntimeException('No refresh token is available.');
			}

			$token = $token['refresh_token'];
		}

		$data['grant_type'] = 'refresh_token';
		$data['refresh_token'] = $token;
		$data['client_id'] = $this->getOption('clientid');
		$data['client_secret'] = $this->getOption('clientsecret');
		$response = $this->http->post($this->getOption('tokenurl'), $data);

		if ($response->code >= 200 || $response->code < 400)
		{
			if ($response->headers['Content-Type'] == 'application/json')
			{
				$token = array_merge(json_decode($response->body, true), array('created' => time()));
			}
			else
			{
				parse_str($response->body, $token);
				$token = array_merge($token, array('created' => time()));
			}

			$this->setToken($token);

			return $token;
		}
		else
		{
			throw new \Exception('Error code ' . $response->code . ' received refreshing token: ' . $response->body . '.');
		}
	}
1303910
public function get_user_info( $access_token ) {
		$contents = $this->get_contents( 'user_info_url', [ 'access_token' => $access_token ] );
		$info     = @json_decode( $contents, true );
		if ( empty( $info ) ) {
			$this->app->log( 'social response error', [
				'$contents' => $contents,
				'$info'     => $info,
			] );

			return null;
		}

		return $info;
	}
454164
public function getToken($forceRefresh = false)
    {
        $cached = $this->getCache()->fetch($this->getCacheKey()) ?: $this->token;

        if ($forceRefresh || empty($cached)) {

            $result = $this->getTokenFromServer();

            $this->checkTokenResponse($result);

            $this->setToken(
                $token = $result[$this->tokenJsonKey],
                $this->expiresJsonKey ? $result[$this->expiresJsonKey] : null
            );

            return $token;
        }

        return $cached;
    }
662544
def refresh_token(token, session=None):
    
    session = session or HTTP_SESSION
    refresh_data = dict(
        refresh_token=token.refresh_token,
        client_id=token.consumer_key,
        client_secret=token.consumer_secret,
        grant_type='refresh_token'
    )
    resp = session.post(REFRESH_TOKEN_URL, data=refresh_data)
    resp_json = resp.json()
    if 'error' in resp_json:
        message = resp_json['error']
        description = resp_json.get('error_description', '')
        if any(description):
            message = u'{}: {}'.format(message, description)
        raise OAuthTokenExpiredError(message)
    return OAuthToken(
        access_token=resp_json['access_token'],
        refresh_token=token.refresh_token,
        consumer_key=token.consumer_key,
        consumer_secret=token.consumer_secret
    )
204161
protected function refreshAccessToken(){
        $config = $this->config;
        if (empty($config['app_id']) || empty($config['app_secret'])){
            if ($this->business_interface) $this->business_interface->log('APP_ID or APP_SECRET must be set');
            return null;
        }

        $url = self::API_ACCESS_TOKEN."grant_type=client_credential&appid={$config['app_id']}&secret={$config['app_secret']}";
        $result = $this->curl_access_token($url);
        if (!empty($result)) {
            $result = json_decode($result,true);
            if (empty($result['access_token'])) {
                if ($this->business_interface) $this->business_interface->log("Weixin Exception:errcode:{$result['errcode']},errmsg:{$result['errmsg']}");
                return null;
            }
            if ($this->business_interface) $this->business_interface->cache_access_token($result);
            return $result['access_token'];
        }
        return null;
    }
719295
def refresh_token(self, refresh_token):
        

        response = requests.post('%saccess_token' % OAUTH_URL, {
                                 'refresh_token': refresh_token,
                                 'grant_type': 'refresh_token',
                                 'client_id': self.client_id,
                                 'client_secret': self.client_secret
                                 })
        resp = json.loads(response.content)

        if 'access_token' in resp:
            self.token = resp['access_token']

        return resp