Secure OAuth patterns for Snowflake Cortex AI through Amazon Bedrock AgentCore
When an AI agent on Amazon Bedrock AgentCore calls Snowflake Cortex AI over MCP, how does it authenticate? This post walks through three OAuth patterns we tested on AgentCore Identity: Snowflake OAuth, three-legged OAuth with a corporate IdP, and two-legged OAuth, so you can match your organization's identity, audit, and compliance needs.
In the digital age, organizations must establish robust authentication and authorization mechanisms for AI agents operating within scalable platforms like Amazon Bedrock AgentCore. This is particularly crucial when such agents interact with external services, such as Snowflake's managed MCP server, which offers Cortex Search and Cortex Analyst as tool types.
To address this challenge, Amazon Bedrock AgentCore Identity provides three distinct OAuth configurations: Snowflake OAuth (per-user, no external IdP), three-legged OAuth with a third-party IdP (corporate SSO), and two-legged OAuth with a third-party IdP (shared service user). Moreover, Amazon Bedrock AgentCore Identity supports an on-behalf-of (OBO) grant (TOKEN_EXCHANGE) that provides per-user identity for unattended workloads without requiring a consent prompt.
By examining these configurations end-to-end, enterprises can determine the most suitable approach for their specific scenarios. Amazon Bedrock AgentCore Gateway, a capability of Amazon Bedrock AgentCore, establishes a connection between AI agents and external tool providers via MCP server targets, presenting them with a unified catalog of available tools.
The core focus of this discussion is the outbound authentication process for Amazon Bedrock AgentCore Gateway, specifically how it obtains and presents OAuth tokens to the Snowflake-managed MCP server. Amazon Bedrock AgentCore Identity functions as the credential broker, responsible for obtaining a workload token, caching, and refreshing tokens automatically.
The solution supports three OAuth configurations, including Snowflake OAuth, three-legged OAuth with a third-party IdP, and two-legged OAuth with a third-party IdP. In addition, Amazon Bedrock AgentCore Identity offers an API-key credential provider for per-user attribution and automatic token refresh.
When implementing these OAuth patterns, it is essential to configure Amazon Bedrock AgentCore Identity with the corresponding credential provider and security integration, as well as set the OAUTH_AUTHORIZATION_SERVER parameter to ensure seamless interaction with the Snowflake-managed MCP server. This enables agents to auto-discover the IdP through the Protected Resource Metadata endpoint and issuer-lock the MCP endpoint to the chosen integration.
While the Snowflake-specific elements of this OAuth approach may vary depending on the SaaS provider's internal OAuth server, the general principles remain applicable across different scenarios.
Written by urgent.news from AWS Machine Learning's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.