HTTPS CloudMcpServer.java Java MCP SDK HttpClient REST → LAMBDA API Gateway 5 a TemperatureLambda Loc l Bridge AWS AGENTCORE GATEWAY Managed MCP endpoint REST → LAMBDA Same API Gateway Same
the URL can call the existing endpoint. GET /5100/temperature?value=86&from=F&to=C HTTP 200 { "value": 86.0, "from": "F", "to": "C", "result": 30.0 } Question: How do we require a user to sign in first?
module. <dependency> <groupId>software.amazon.awssdk</groupId> <artifactId>cognitoidentityprovider</artifactId> <version>${aws.sdk.version}</version> </dependency> Use the same AWS SDK v2 version management as our previous Lambda exercises. 7
allowed to call it? Before After Keep Lambda unchanged GET /5100/temperature GET /5100/temperaturesecure API Gateway checks identity before invoking the same Lambda No authentication required Authorization: Bearer <JWT>
different responsibilities User Pool App Client Directory of users Defines how an application signs in Credentials, password policy, MFA, account recovery Authentication flows, client ID, optional secret Example: CSC5100-Java Example: CSC5100 One User Pool can serve several app clients (Java, web, mobile).
will run Traditional web Server-side application Often uses confidential client credentials SPA Mobile (Single-Page Application) Machine-tomachine Installed app Service-to-service Public client; no embedded secret Client credentials; no human login Browser app Public client; no client secret Our classroom choice: SPA as a convenient way to create a public app client for Java.
by our Java code Username and password Secure remote password Choice-based sign-in Existing session ALLOW_USER_PA SSWORD_AUTH SRP protocol avoids sending the raw password as a direct auth parameter. Cognito can present or negotiate available sign-in methods. USER_AUTH session-related token acquisition / refresh behavior, depending on flow. Our InitiateAuth example uses this.
Java client API Gateway Authenticates a person Obtains token Validates token Issues signed access tokens Sends Bearer token Invokes existing Lambda Next: AgentCore Gateway protects remote MCP calls with a related OAuth/JWT flow.
2026 Copyright. These slides may be used only as study material for CSC 5100 within the California State University system. They may not be distributed or used for any other purpose.