TsgcHTTP_OAuth2_ClientMethods › Refresh

Refresh Method

Requests a new access token using a refresh token.

Syntax

procedure Refresh(const aRefreshToken: String);

Parameters

NameTypeDescription
aRefreshTokenconst StringThe refresh token previously obtained from the authorization server (typically from CurrentRefreshToken or the OnAfterAccessToken event).

Remarks

Posts grant_type=refresh_token to AuthorizationServerOptions.AccessTokenURL to obtain a new access token without user interaction. Use this when AccessToken has expired (see Expires_In) but the refresh token is still valid. The OnBeforeRefreshToken, OnAfterRefreshToken and OnErrorRefreshToken events fire around the request.

Example

oAuth2.Refresh(oAuth2.CurrentRefreshToken);

Back to Methods