OAuth2\Service::refreshAccessToken PHP Method

refreshAccessToken() public method

refresh access token
public refreshAccessToken ( Token $token ) : Token
$token Token
return Token new token object
    public function refreshAccessToken(Token $token)
    {
        if (!$token->getRefreshToken()) {
            throw new Exception('could not refresh access token, no refresh token available');
        }
        $parameters = array('grant_type' => 'refresh_token', 'type' => 'web_server', 'client_id' => $this->_client->getClientKey(), 'client_secret' => $this->_client->getClientSecret(), 'refresh_token' => $token->getRefreshToken());
        $http = new HttpClient($this->_configuration->getAccessTokenEndpoint(), 'POST', http_build_query($parameters));
        $http->execute();
        return $this->_parseAccessTokenResponse($http, $token->getRefreshToken());
    }