TOidcClient.RefreshTokens Method
Exchanges a refresh token for a new set of tokens.
Remarks
The caller is responsible for supplying a valid refresh token. The server endpoint and client authentication are derived from the current Authority and ClientId settings, so CheckProviderInformation is called automatically before the request.
If the server issues a new refresh token in the response (token rotation), it replaces the value in the returned result. If the server omits the refresh token, the original ARefreshToken value is preserved in the result.
Syntax
Unit: Sphinx.OidcClient
function TOidcClient.RefreshTokens(const ARefreshToken: string; const AScope: string): TAuthResult;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| const | ARefreshToken | string | The refresh token to exchange. |
| const | AScope | string | Optional scope to request. If empty, the server grants the same scope as the original authorization. The requested scope cannot exceed the scope of the original grant. |
Returns
An TAuthResult containing the new access token, a new refresh token (if the server implements token rotation), and optionally a new identity token.
The caller is responsible for destroying the returned TAuthResult instance.