Table of Contents

TSphinxWebLogin.RefreshTokens Method

Refreshes the stored tokens using the stored refresh token.

Remarks

On success, the new tokens are automatically saved to browser local 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.WebLogin

function TSphinxWebLogin.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).

See also