McpOAuthTokens

class McpOAuthTokens(registration: McpOAuthRegistration, store: TokenStore, client: OAuthClient = OAuthClient(), now: () -> Long = System::currentTimeMillis) : McpAuth(source)

McpAuth over OAuth tokens kept in store: refreshes shortly before expiry and after a 401, single-flight, sending the resource indicator.

Constructors

Link copied to clipboard
constructor(registration: McpOAuthRegistration, store: TokenStore, client: OAuthClient = OAuthClient(), now: () -> Long = System::currentTimeMillis)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun refresh(): Boolean

Called after a 401; return true when a new token is available and the request should be retried once.

Link copied to clipboard
open suspend override fun token(): String?

The token to send, or null for none.