Get Refresh token.

@return mixed
482611
public function getRefreshToken() {
        if (empty($this->refreshToken)) {
            $this->refreshToken = $this->sessionStorage->read('refresh_token');
            return $this->refreshToken;
        }
        return $this->refreshToken;
    }
278653
public function getRefreshToken($refresh_token)
    {
        $result = $this->client->getItem(array(
            "TableName"=> $this->config['refresh_token_table'],
            "Key" => array('refresh_token'   => array('S' => $refresh_token))
        ));
        if ($result->count()==0) {
            return false ;
        }
        $token = $this->dynamo2array($result);
        $token['expires'] = strtotime($token['expires']);

        return $token;
    }
998968
public function getAccessToken()
    {
        if ($this->accessToken && $this->accessToken->isExpired()) {
            // The access token has expired.
            $this->accessToken = null;
        }

        if (null === $this->accessToken) {
            // Try to acquire a new access token from the server.
            $this->accessToken = $this->acquireAccessToken();
            if ($this->accessToken) {
                $this->refreshToken = $this->accessToken->getRefreshToken() ?: null;
            }
        }

        return $this->accessToken;
    }
1118273
public function refreshUserAccessToken($refresh_token) {
		$data = $this->getData('/sns/oauth2/refresh_token', [
			'appid' => $this->app->appid,
			'grant_type' => 'refresh_token',
			'refresh_token' => $refresh_token,
		]);

		return $this->errcode == 0 ? $data : [];
	}
1264359
function get()
    {
        $result = $this->client->get($this->requestDecorator->makeResource(), $this->requestDecorator->makeQuery());
        $this->refresh();
        return $result;
    }
633550
public function refreshTokens()
    {
        $headers = array(
            'Content-Type' => 'application/x-www-form-urlencoded'
        );

        $headers = $this->injectUserAgent($headers);

        $res = $this->getHttpClient()->post($this->entrypoint . '/oauth/token', array(
            'client_id' => $this->getClientId(),
            'client_secret' => $this->getClientSecret(),
            'refresh_token' => $this->getRefreshToken()
        ), array(
            'grant_type'=>'refresh_token'
        ), $headers);

        if(!$res) {
            throw new OAuthException('General failure', OAuthException::GENERAL_FAILURE);
        } elseif(isset($res['data']['error'])) {
            $description = 'General failure';
            if(isset($res['data']['error_description'])) {
                $description = $res['data']['error_description'];
            }
            throw new OAuthException(array(
                'message' => $description,
                'http_error' => $res['data']['error']
            ), OAuthException::API_ERROR);
        }

        $this->accessToken = $res['data']['access_token'];
        $this->refreshToken = $res['data']['refresh_token'];
        $this->expiresIn = (int)$res['data']['expires_in'];
        $this->scopes = explode(',', $res['data']['scope']);

        return $res['data'];
    }
36070
private function acquireAccessToken()
    {
        if (isset($this->accessToken) && $this->accessToken->getRefreshToken()) {
            return $this->provider->getAccessToken(new RefreshToken(), ['refresh_token' => $this->accessToken->getRefreshToken()]);
        }

        return $this->provider->getAccessToken($this->grant, $this->grantOptions);
    }
927282
public function getRefreshToken($tenantKey)
    {
        $tenantKey = $tenantKey == null ? $this->tenantKey : $tenantKey;
        if ($this->tenantTokens[$tenantKey] == null) {
            $this->tenantTokens[$tenantKey] = array();
        }
        return isset($this->tenantTokens[$tenantKey]['refreshToken'])
            ? $this->tenantTokens[$tenantKey]['refreshToken']
            : null;
    }
558966
public function getToken($refresh = false)
    {
        if ($refresh || empty($this->_token)) {
            $data = ['grant_type' => 'client_credentials'];
            $this->_token = $this->_request(self::URN_ISSUE, $data);

            // check for valid response
            if (empty($this->_token->access_token)) {
                throw new AuthException('Unexpected empty token from the authentication server');
            }
        }
        return $this->_token;
    }
612011
public function refresh() {
    $grant = new ClientCredentialsGrantRequest($this->clientId, $this->clientSecret, $this->scopes);
    $tokens = $grant->getTokens();

    $this->accessToken = $tokens->{"access_token"};
    $this->expiresAt = Util::calculateExpiryTime($tokens->{"expires_in"});
  }
1025026
public function getOauthRefreshToken($refresh_token){
        $result = $this->http_get(self::API_BASE_URL_PREFIX.self::OAUTH_REFRESH_URL.'appid='.$this->appid.'&grant_type=refresh_token&refresh_token='.$refresh_token);
        if ($result)
        {
            $json = json_decode($result,true);
            if (!$json || !empty($json['errcode'])) {
                $this->errCode = $json['errcode'];
                $this->errMsg = $json['errmsg'];
                return false;
            }
            $this->user_token = $json['access_token'];
            return $json;
        }
        return false;
    }
37563
public function getToken()
    {

        $request = new Request();

        if ($request->isPost() === true) {
            $this->token = $request->getPost('token', null, false);
        } else {
            $this->token = $request->getQuery('token', null, false);
        }

        return $this->token;
    }
610008
public function refresh()
    {
        $token = Auth::guard()->refresh();

        return response()->json([
            'status' => 'ok',
            'token' => $token,
            'expires_in' => Auth::guard()->factory()->getTTL() * 60
        ]);
    }
612950
public function getTokens($refresh = false)
    {
        if (! $this->_tokens || $refresh) {
            if ($refresh) {
                $this->_firstToken = null;
            }
            $this->_tokens       = array();
            $this->_activeTokens = array();
            $tokenSelect = $this->tracker->getTokenSelect();
            $tokenSelect->andReceptionCodes()
                ->forRespondentTrack($this->_respTrackId);

            $tokenRows = $tokenSelect->fetchAll();
            $prevToken = null;
            foreach ($tokenRows as $tokenData) {

                $token = $this->tracker->getToken($tokenData);

                $this->_tokens[$token->getTokenId()] = $token;

                // While we are busy, set this
                if ($token->hasSuccesCode()) {
                    $this->_activeTokens[$token->getRoundId()] = $token;
                }

                // Link the tokens
                if ($prevToken) {
                    $prevToken->setNextToken($token);
                }
                $prevToken = $token;
            }
        }

        return $this->_tokens;
    }
78046
public function refreshToken($accessToken = null)
    {
        $accessToken = $accessToken ?: $this->accessToken;
        $this->accessToken = $this->provider->getAccessToken('refresh_token', [
            'refresh_token' => $accessToken->getRefreshToken()
        ]);
        return $this->accessToken;
    }
150775
public function getToken()
    {
        if (Cache::has(self::CACHE_NAME)) {
            return Cache::get(self::CACHE_NAME);
        } else {
            $url    = $this->url."token";
            $option = [
                'grant_type'    => 'client_credentials',
                'client_id'     => $this->client_id,
                'client_secret' => $this->client_secret,
            ];
            $return = Http::postCurl($url, $option);
            Cache::put(self::CACHE_NAME, $return['access_token'], (int) ($return['expires_in'] / 60));

            return $return['access_token'];

        }
    }
685738
public function getAndStoreToken()
    {
        $token = $this->generateToken(6);
        
        $this->setAttribute('secure_token', sha1($token));
        $this->setAttribute('secure_token_timestamp', time());
        $this->update(false);

        return $token;
    }