Package org.apache.juneau.examples.mcp.secured


package org.apache.juneau.examples.mcp.secured
  • Classes
    Class
    Description
    A minimal, self-contained, in-process stand-in for a real OAuth 2.1 authorization server (AS), so the secured MCP example (and its end-to-end test) run entirely offline — no external IdP, no network access, no pre-shared secrets checked into source control.
    A guided walkthrough of calling SecuredExampleMcpServer, showing the secured request/response cycle a newcomer to MCP OAuth 2.1 needs to see: a rejected unauthenticated call (twice — once at the raw wire level, once through the real McpClient SDK), the full RFC 9728 → RFC 8414 discovery chain, a successful read-only call, a scoped step-up rejection, and finally a successful write once a token carrying the write scope has been acquired.
    The OAuth 2.1-secured variant of ExampleMcpServer: identical notes-service surface (tools, prompt, resources, resource template, subscriptions), but every POST / JSON-RPC call now requires a valid bearer token.
    Boots SecuredExampleMcpServer on an embedded Jetty server, alongside an in-process OfflineAuthorizationServer that stands in for a real OAuth 2.1 authorization server.