Scalr\Service\Azure::getRefreshToken PHP Method

getRefreshToken() public method

Getter for Refresh Token.
public getRefreshToken ( ) : object
return object stdClass with next properties : token, expireDate and error.
    public function getRefreshToken()
    {
        if (!$this->refreshToken) {
            $this->refreshToken = $this->loadToken(self::TOKEN_TYPE_REFRESH);
        }
        if (!$this->refreshToken || $this->refreshToken->expireDate <= time()) {
            throw new AzureException('Refresh token is expired or not exists! Please process authorisation flow to continue working.');
        }
        $this->environment->keychain(\SERVER_PLATFORMS::AZURE)->properties->saveSettings([CloudCredentialsProperty::AZURE_REFRESH_TOKEN => $this->refreshToken->token, CloudCredentialsProperty::AZURE_REFRESH_TOKEN_EXPIRE => $this->refreshToken->expireDate]);
        return $this->refreshToken;
    }