Creates a new instance of the RefreshingAuthProvider
.
The configuration object that defines client credentials and settings.
Readonly
onFires when a user's token is successfully refreshed.
The updated AccessToken object.
Adds a user to this provider, associating them with the provided token data.
The ID of the user to add.
The token data, including refresh and access tokens.
InvalidTokenError if the access or refresh tokens are invalid.
MissingScopeError if the token does not match the required scopes.
Exchanges a grant authorization code for an access token and registers the user in this auth provider.
The authorization code.
Optional
scopes: string[]Optional scopes that the user granted when retrieving the code. These scopes will be compared against the scopes specified in the constructor.
The redirectUri
option must be specified in RefreshingAuthProviderConfig to complete
this flow successfully.
Determines the user ID from an access token and registers that user.
If you already know the user's ID, using addUser might be preferable.
The token data, including refresh and access tokens.
Gets the access token data for the specified user.
The ID of a user whose token is being requested.
Optional
scopes: string[]An optional list of required scopes to validate against the token's current scopes.
UnregisteredUserError if the user is not registered with this provider.
MissingScopeError if the token does not include the required scopes.
Retrieves the scopes currently associated with the specified user's access token.
Returns an empty array if no scopes were set during user registration.
The ID of a user whose scopes should be retrieved.
UnregisteredUserError - Thrown if the user is not registered with this provider.
Checks whether the specified user is registered in this provider.
The ID of the user to check.
Forces a token refresh for the specified user and updates the provider's registry accordingly.
The ID of the user to add.
UnregisteredUserError if the user is not registered in this provider.
InvalidTokenError if the refresh token is missing or invalid.
Removes a user from this provider.
The ID of the user to remove.
An authentication provider that automatically refreshes user access tokens when they expire.