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;
}