TsgcHTTP_OAuth2_Client › Methods › Refresh
Requests a new access token using a refresh token.
procedure Refresh(const aRefreshToken: String);
| Name | Type | Description |
|---|---|---|
aRefreshToken | const String | The refresh token previously obtained from the authorization server (typically from CurrentRefreshToken or the OnAfterAccessToken event). |
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.
oAuth2.Refresh(oAuth2.CurrentRefreshToken);