TSphinxLogin.RefreshTokens Method
Refreshes the stored tokens using the stored refresh token.
Remarks
On success, the new tokens are automatically saved to the component's internal storage, so subsequent calls to AuthResult and IsLoggedIn reflect the refreshed state. The method never raises an exception; all failures are reported by returning nil.
Refresh tokens are only issued by the server when the offline_access scope was included in the original authorization request via the Scope property. If the server implements token rotation, the new refresh token replaces the old one in storage automatically.
Syntax
Unit: Sphinx.Login
function TSphinxLogin.RefreshTokens(const AScope: string): IAuthResult;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| 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
The new IAuthResult with updated tokens on success, or nil if the refresh could not be completed (no stored result, no refresh token, or the server rejected the request).