Retrieves the current authorization credentials.
Called before each request and before each retry attempt on 401 responses. Implementations may return cached tokens or fetch fresh ones as needed.
A promise resolving to the authorization token credentials.
Provider interface for retrieving authorization credentials.
Implement this interface to supply tokens to the withAuthorization middleware. The provider is called before each request and on retry after 401 responses, allowing for token refresh or rotation.
Example
Example