Skip to content

Agentcore Identity Multiple/ Optional Inbound Auth

0

So I have an agent deployed on Agentcore with tools defined from a Gateway MCP. The problem I'm facing is that some of the MCP tools require Okta OAuth others do not since some tool require users to be signed into their account. However Agentcore Identity only seems to support one auth mechanism per agent/MCP. If I use the default Cognito then it will prevent logged in users from calling tools to modify their account but if I use the custom OAuth with Okta (my authentication provider) then it limits the MCP to only users with an account. I want to make the JWT token optional but Gateway fails if the Authorization header is empty. If that is not possible then I want to allow both types of Auth (Cognito and OAuth) for the Gateway. Otherwise it seems the only solution I have left is creating a whole new MCP just for logged in users. I'm not sure if I'm missing something but having such strict rules kind of defeats the purpose of having Agentcore Identity management

2 Answers
0

Amazon Bedrock AgentCore Gateway requires authentication for both inbound and outbound connections, and currently, you can only configure one authentication mechanism per gateway.

For inbound authentication, you have two main options: IAM-based or JWT-based authorization. When you create a gateway with JWT-based authentication, you specify an authorizer configuration that validates tokens from specific identity providers like Amazon Cognito, Okta, or EntraID.

Based on your scenario, here are some potential approaches:

  1. Create separate gateways: Since you have tools that require different authentication mechanisms, you could create two separate gateways - one configured with Okta OAuth for authenticated users and another with Cognito for unauthenticated access. Your agent can then be configured to use both gateways, directing requests to the appropriate one based on whether the user is authenticated.

  2. Implement a proxy layer: You could create an intermediary service that sits between your application and the AgentCore Gateway. This proxy would handle the authentication logic, determining whether a user needs to be authenticated with Okta or can proceed with the default Cognito authentication, then route the request accordingly.

  3. Use a unified identity approach: Consider implementing a solution where all users get some form of identity, even if they're not fully authenticated. Unauthenticated users could receive a limited-scope token from Cognito, while authenticated users would use their Okta credentials. This would require customizing your authentication flow.

AgentCore Identity is designed to support both user-delegated access (using OAuth 2.0 authorization code grant) and machine-to-machine authentication patterns simultaneously for different aspects of functionality. However, the gateway itself currently requires a consistent authentication configuration.

The most straightforward solution given the current constraints would be to create separate gateways for different authentication requirements, though this does add complexity to your architecture.
Sources
Supported authentication patterns - Amazon Bedrock AgentCore
Set up inbound authorization for your gateway - Amazon Bedrock AgentCore
Move your AI agents from proof of concept to production with Amazon Bedrock AgentCore | Artificial Intelligence
Introducing Amazon Bedrock AgentCore Identity: Securing agentic AI at scale | Artificial Intelligence

answered a year ago

0

Hello,

Please allow me to inform you that Amazon Bedrock AgentCore Gateway currently supports only one authentication mechanism per gateway — either IAM-based or JWT-based (like Okta or Cognito). It does not allow optional JWT tokens or multiple identity providers on the same gateway.

To handle both authenticated and unauthenticated tools, you can either create separate gateways (one with Okta OAuth, one with Cognito) or use a proxy layer that routes requests based on auth type. A unified identity setup using guest Cognito tokens for unauthenticated users is another option. The simplest supported approach is to use separate gateways for different auth needs.

For better assistance, I kindly request you to please reach out to Premium Support so that we can check your use case and current configuration better.

I kindly request you to please stay updated through these blogs:

If you have any questions or would like more details about this feature or roadmap, please reach out to AWS Support, and we would be happy to assist you further.

—References—

[1] Creating support cases and case management: https://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-casehttps://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-case

[2] https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/common-use-cases.html

[3] https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/gateway-inbound-auth.html

AWS

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.