Obtains fresh credentials before the current ones expire. Optional.
Implementor responsibilities:
- Resolve with a new
SDKCredential containing an updated token (or authorizationState) and expiry_at.
- Reject (throw) if refresh is not possible — the SDK will stop the refresh schedule.
SDK behavior:
- Only called when
expiry_at was set on the previous credential.
- Scheduled automatically before expiry; implementors do not need to manage timing.
- On rejection, the refresh schedule stops and the session continues with the
current credentials until they expire.
- When not provided and the SAT includes a
sat:refresh scope, the SDK
automatically refreshes via Client Bound SAT (DPoP) without developer intervention.
- When not provided and no refresh scope is present, the SDK uses the initial
credentials for the entire session lifetime.
Returns
Promise<{ expiry_at: number; token: string; }>
Examples