Gets valid tokens for a connection, refreshing if needed.
MCP Server Connection ID
Client registration for token refresh
Token endpoint URL
User context
Valid token set
Handles a refresh failure by determining if re-authorization is needed.
The error message from the failed refresh
Object indicating whether re-authorization is required
Checks if a token set is valid (not expired or expiring soon).
Token set to check
true if valid
Checks if stored tokens are valid (not expired or expiring soon).
MCP Server Connection ID
User context
true if tokens are valid
Loads tokens for a connection.
MCP Server Connection ID
User context
Token set or null if not found
Refreshes tokens using the refresh token.
Uses concurrent refresh protection to prevent multiple simultaneous refresh operations for the same connection.
MCP Server Connection ID
Current token set with refresh token
Client registration for authentication
Token endpoint URL
User context
Refresh result
Revokes stored credentials for a connection.
Deletes both the OAuthToken metadata and the associated credential.
MCP Server Connection ID
User context
Optionalprovider: IMetadataProviderStores new OAuth tokens for a connection.
Creates or updates a credential via CredentialEngine, then stores metadata in the OAuthToken table.
MCP Server Connection ID
Token set to store
User context
Optionalprovider: IMetadataProvider
Manages OAuth token storage, validation, and refresh.
Features:
Example