cd /news/ai-agents/amazon-bedrock-agentcore-gateway-how… · home › topics › ai-agents › article
[ARTICLE · art-173476] src=contextiq.trango-compute.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Amazon Bedrock AgentCore Gateway: How to Inspect the MCP OAuth Setup (JWT Authorizer, Cognito, Okta, RFC 9728, CloudFront)

A new technical walkthrough documents how to inspect the OAuth setup of an Amazon Bedrock AgentCore Gateway MCP endpoint, covering the four inbound authorization modes — CUSTOM_JWT, IAM, AUTHENTICATE_ONLY and NONE — and the discovery chain a JWT-protected gateway exposes to unauthenticated callers. The guide, based on AWS's AgentCore Gateway inbound authorization documentation, shows that a CUSTOM_JWT gateway returns a 401 with a WWW-Authenticate header carrying resource_metadata and scope parameters per RFC 6750, and that a valid token missing required scopes gets a 403 with error="insufficient_scope". It warns that a gateway configured with authorizerType NONE answers tools/list anonymously and enforces nothing unless authorization is handled by a policy engine, interceptor Lambda function or the downstream target.

recommendation

Probe each AgentCore Gateway with an unsigned MCP initialize call: expect a 401 with resource_metadata for CUSTOM_JWT, and treat any anonymous tools/list response as a NONE gateway that needs an interceptor or policy engine.

more in playbook: Securing agents and AI tools
by read7 min views2 publishedNov 20, 2026

Check an Amazon Bedrock AgentCore Gateway MCP endpoint's OAuth setup: Cognito, Okta, Auth0 or Entra ID JWT authorizers, RFC 9728 metadata, CloudFront domainOverride.

Amazon Bedrock AgentCore Gateway turns APIs, Lambda functions and other targets into a single MCP endpoint that agents can call. Every gateway is a remote MCP server, and every remote MCP server has the same first question: what does it say to a caller who shows up with no token?

This post maps the four inbound authorization modes of AgentCore Gateway to what an outside caller can observe, walks the OAuth discovery chain for a JWT-protected gateway with curl, and lists the checks worth running before you hand the gateway URL to an agent. It is based on the AgentCore Gateway inbound authorization documentation; check that page for the current field names, since the service is new and changes quickly.

The gateway endpoint #

An AWS-managed gateway URL has this shape:

https://<gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp

MCP traffic goes to /mcp. For a JWT-protected gateway, the OAuth metadata lives at /.well-known/oauth-protected-resource on the same host.

Four inbound modes, four different views from outside #

The authorizerType you choose when creating the gateway decides what an unauthenticated caller sees.

authorizerType What the gateway checks What an unauthenticated scan can observe
CUSTOM_JWT A bearer token, validated against the identity provider's discovery URL, plus allowed clients, audience and scopes A 401 with aWWW-Authenticate challenge and a link to protected resource metadata, so the whole discovery chain is testable
IAM A SigV4 signature, and the bedrock-agentcore:InvokeGateway permission on the gateway ARN Requests must be signed, so an unsigned scan cannot list tools
AUTHENTICATE_ONLY A valid SigV4 signature, with no authorization decision of its own Same as IAM : signed requests only
NONE Nothing tools/list answers anonymously

Only the first and last rows are visible to a passive, unauthenticated check. The NONE row is the one to look at twice. The AWS documentation is explicit that with NONE the gateway enforces nothing and authorization has to live in a policy engine, an interceptor Lambda function or the downstream target. If none of those exist, any caller reaches your targets.

Walking the discovery chain for a JWT gateway #

For a CUSTOM_JWT gateway, AWS documents that a request without a valid token gets a 401 whose WWW-Authenticate header carries resource_metadata and scope parameters, following the RFC 6750 Bearer challenge format. A valid token that lacks the required scopes gets a 403 with error="insufficient_scope".

Step 1: send an unauthenticated MCP request and read the headers.

curl -si -X POST https://<gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/mcp \
  -H 'content-type: application/json' \
  -H 'accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"probe","version":"0"}}}'

You want a 401 and a WWW-Authenticate: Bearer ... resource_metadata="..." scope="..." header.

Step 2: fetch the protected resource metadata named in resource_metadata (RFC 9728).

curl -s https://<gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com/.well-known/oauth-protected-resource | jq

This document names the resource and the authorization_servers.

Step 3: fetch the authorization server's metadata (RFC 8414 or OpenID Connect discovery) from each listed server, for example <issuer>/.well-known/openid-configuration. For an Amazon Cognito user pool that is the pool's issuer URL plus that path; for Okta, Auth0 or Microsoft Entra ID it is the tenant's issuer.

The chain is the same one covered in how to debug an MCP server that returns 401. What is specific to AgentCore is how the gateway is configured behind the scenes: the discoveryUrl in the gateway's customJWTAuthorizer is where the gateway fetches the identity provider's metadata, and allowedClients and allowedAudience decide which tokens it accepts.

The checks worth running #

The MCP Inspector runs this chain automatically and reports what the endpoint publishes. For an AgentCore gateway, these are the findings that matter:

  1. A challenge with resource_metadata. Without it, an MCP client has no standard way to find the authorization server.
  2. The authorization server is the one you configured. The protected resource metadata names the issuer clients will send credentials to. It should be the identity provider behind the gateway'sdiscoveryUrl , and nothing else. Clients should pin that issuer rather than trust whatever the server advertises; seePin the Issuer for why.
  3. The resource host matches the endpoint host. This one catches a real AgentCore deployment pattern, covered in the next section.
  4. Scopes are published. The gateway advertises its allowed scopes in the challenge. If neither the challenge nor the metadata lists any, a reviewer cannot tell what a token would carry.
  5. OpenID Connect or bare OAuth 2.0. Whether the authorization server publishes/.well-known/openid-configuration or only OAuth 2.0 metadata decides whether you can map standard identity claims. The inspector also reads the server's published metadata for PKCE with S256, pushed authorization requests, and DPoP, and reports each as published or not published. That is a read of published metadata, not a conformance test.
  6. Anonymous tool inventory for NONE gateways. Iftools/list answers without a token, the inspector lists the tools it returned and marks the view as anonymous.

The CloudFront and domainOverride case #

Many teams put a custom domain or CloudFront in front of a gateway. AWS documents what happens next: by default the gateway advertises its AWS-managed hostname in the protected resource metadata and in WWW-Authenticate challenges. A client calling https://mcp.example.com/mcp is then told the resource lives at <gateway-id>.gateway.bedrock-agentcore.<region>.amazonaws.com, and OAuth discovery or token validation can fail.

The fix is the gateway's domainOverride setting, with the proxy setting the x-amzn-bedrock-agentcore-gateway-domain header to the public hostname and overwriting any copy the client sent. Because the metadata names a host and the request went to another, this is directly observable from outside: the inspector flags it when the protected resource metadata names a different host than the MCP endpoint that issued the challenge. Path differences are not flagged, since a resource at the origin and an endpoint at /mcp is normal.

What an outside scan cannot see #

Be clear about the limits before you treat a clean scan as a clearance:

  • Token acceptance.allowedClients ,allowedAudience and required scopes are checked server-side on a real token. A passive scan sees none of them. A gateway that accepts tokens with a broad audience looks the same as a strict one.
  • Token passthrough. AWS notes that withJWT_PASSTHROUGH outbound authorization the same token is accepted by both the gateway and the target, so each token'saud should be scoped to the intended resource. Whether your tokens are scoped that way is a property of your identity provider, not of the gateway's public metadata.
  • IAM-protected gateways. The inspector does not sign SigV4 requests, so it cannot inventory tools behindIAM orAUTHENTICATE_ONLY .
  • Private identity providers. AcustomJWTAuthorizer can use aprivateEndpoint for an identity provider inside your VPC. Its metadata is not reachable from the public internet, so a public scan cannot read it.
  • Policy engines and interceptors. Authorization offloaded to a policy engine or an interceptor Lambda function is invisible from outside.
  • Per-caller tool lists. The MCP specification lets servers return different tools to different callers. A scan without a token shows the anonymous view only.

A short pre-launch checklist #

  1. Pick the mode on purpose. Production gateways should be CUSTOM_JWT orIAM , with a policy engine or interceptor whereAUTHENTICATE_ONLY orNONE is used.
  2. Send the unauthenticated request. Confirm the 401 , theresource_metadata parameter and thescope parameter.
  3. Fetch the protected resource metadata. Confirm the resource host is the host your clients call.
  4. Fetch the authorization server metadata. Confirm the issuer is your identity provider and that it publishes the endpoints and PKCE method your clients need.
  5. Scope tokens to the gateway's audience, and prefer on-behalf-of token exchange over passthrough for production, as the AWS documentation recommends.
  6. Re-run the check after every change to the identity provider, the proxy or the gateway configuration.

Scan a gateway URL to see what it publishes today.

Follow Trango Compute on LinkedIn

We post updates on new tools, context engineering patterns, and LLM cost research.

Follow on LinkedIn

── more in #ai-agents 4 stories · sorted by recency
── more on @amazon bedrock agentcore gateway 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/amazon-bedrock-agent…] indexed:0 read:7min 2026-11-20 · —