Interface McpAuthHandler

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface McpAuthHandler
Handles MCP OAuth requests from the runtime.
Since:
1.0.0
  • Method Details

    • handle

      Handles an MCP OAuth request.
      Parameters:
      request - the MCP OAuth request details
      invocation - the invocation context with session information
      Returns:
      a future resolving to token data or cancellation
    • handleWithRuntimeRefresh

      default CompletableFuture<McpAuthResponse> handleWithRuntimeRefresh(McpAuthRequest request, McpAuthInvocation invocation, boolean runtimeRefreshSupported)
      Handles an OAuth request with an optional runtime-owned refresh capability. The default preserves the legacy handler. An adopting host must choose an eligible advertised Refresh before calling handle(McpAuthRequest, McpAuthInvocation); do not first schedule legacy detached recovery and then convert its cancellation.
      Parameters:
      request - the unchanged legacy request
      invocation - the invocation context
      runtimeRefreshSupported - whether this request advertises refresh handoff; omission is false
      Returns:
      a future resolving to a legacy response or runtime refresh