View a markdown version of this page

자격 증명 공급자 구성 - Amazon Bedrock AgentCore

자격 증명 공급자 구성

AgentCore Identity의 리소스 자격 증명 공급자는 에이전트, 자격 증명 공급자 및 리소스 서버 간의 복잡한 관계를 관리하는 지능형 중개자 역할을 합니다. 각 공급자는 특정 서비스 또는 자격 증명 시스템에 필요한 특정 엔드포인트 구성을 캡슐화합니다. 이 서비스는 Google, GitHub, Slack, Salesforce 등 인기 있는 서비스를 위한 기본 제공 공급자에 개발 노력을 줄이기 위해 사전 구성된 권한 부여 서버 엔드포인트 및 공급자별 파라미터를 제공합니다. AgentCore Identity는 OAuth2 호환 리소스 서버와 함께 작동하도록 조정할 수 있는 구성 가능한 OAuth2-compatible 자격 증명 공급자를 통해 사용자 지정 구성을 지원합니다. OAuth2 자격 증명 공급자 제한에 대한 자세한 내용은 AgentCore Identity Service Quotas를 참조하세요.

리소스 자격 증명 공급자는 토큰 볼트와 긴밀하게 통합되어 원활한 자격 증명 수명 주기 관리를 제공합니다. 에이전트가 리소스에 대한 액세스를 요청하면 공급자는 인증 흐름을 처리하고, 결과 자격 증명을 토큰 저장소에 저장하고, 에이전트에게 필요한 액세스 토큰을 제공합니다.

OAuth 2.0 자격 증명 공급자 생성

AgentCore Identity의 공급자 구성은 다양한 리소스 및 인증 시스템으로 자격 증명을 관리하는 데 필요한 기본 파라미터를 정의합니다.

AgentCore CLI를 사용하는 경우 agentcore add credential 명령을 사용하여 OAuth 2.0 자격 증명 공급자를 생성할 수 있습니다.

agentcore add credential --type oauth \ --name github-provider \ --discovery-url https://your-idp/.well-known/openid-configuration \ --client-id your-github-client-id \ --client-secret your-github-client-secret \ --scopes repo,user

CLI는 자격 증명 구성을에 저장agentcore/agentcore.json하고 민감한 값(클라이언트 ID 및 클라이언트 보안 암호)을에 저장합니다agentcore/.env.local.

또는 AWS Secrets Manager에 이미 저장된 클라이언트 보안 암호에 대한 참조를 제공하여 자체 보안 암호를 가져올 수 있습니다.

aws bedrock-agentcore-control create-oauth2-credential-provider \ --name "github-provider" \ --credential-provider-vendor "GithubOauth2" \ --oauth2-provider-config-input '{ "githubOauth2ProviderConfig": { "clientId": "your-github-client-id", "clientSecretSource": "EXTERNAL", "clientSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret", "jsonKey": "clientSecret" } } }' \ --region us-east-1

또는 AgentCore SDK를 사용하여 OAuth 2.0 자격 증명 공급자를 프로그래밍 방식으로 구성할 수 있습니다. 다음 예제에서는 GitHub에 대한 공급자를 구성합니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client = IdentityClient("us-east-1") github_provider = identity_client.create_oauth2_credential_provider({ "name": "github-provider", "credentialProviderVendor": "GithubOauth2", "oauth2ProviderConfigInput": { "githubOauth2ProviderConfig": { "clientId": "your-github-client-id", "clientSecret": "your-github-client-secret" } } })

OAuth 2.0 자격 증명 공급자에서 OBO(Onon-behalf-of) 토큰 교환을 구성하려면 공급자 구성에 onBehalfOfTokenExchangeConfig를 추가합니다. 지원되는 모드, 파라미터 및 예제는 토큰 교환On-behalf-of 참조하십시오.

API 키 자격 증명 공급자 생성

OAuth가 아닌 인증에 API 키를 사용하는 서비스의 경우 AgentCore Identity는 에이전트의 키를 안전하게 저장하고 검색합니다. API 키 자격 증명 공급자 제한에 대한 자세한 내용은 AgentCore Identity Service Quotas를 참조하세요.

AgentCore CLI를 사용하는 경우 단일 명령으로 API 키를 저장할 수 있습니다.

agentcore add credential --name your-service-name --api-key your-api-key

또는 Secrets Manager에 이미 저장된 API 키에 대한 참조를 제공하여 자체 AWS 보안 암호를 가져올 수 있습니다.

aws bedrock-agentcore-control create-api-key-credential-provider \ --name "your-service-name" \ --api-key-secret-source EXTERNAL \ --api-key-secret-config secretId=arn:aws:secretsmanager:us-east-1:123456789012:secret:my-secret,jsonKey=api_key \ --region us-east-1

또는 AgentCore SDK를 사용하여 API 키를 프로그래밍 방식으로 저장할 수 있습니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client= IdentityClient("us-east-1") apikey_provider= identity_client.create_api_key_credential_provider({ "name": "your-service-name", "apiKey": "your-api-key" })

결제 자격 증명 공급자 생성

Coinbase CDP 또는 Stripe Privy와 같은 결제 프로세서 자격 증명을 사용하는 서비스의 경우 AgentCore Identity는 연결된 API 키, 앱 보안 암호 및 Wallet/Authorization 보안 암호를 Secrets Manager에 안전하게 저장하고 에이전트에게 해당 ARNs만 표시합니다. 결제 자격 증명 공급자 제한에 대한 자세한 내용은 AgentCore Identity Service Quotas를 참조하세요.

결제 자격 증명 공급자는 현재 CoinbaseCDP 및의 두 공급업체를 지원합니다StripePrivy. credentialProviderVendor 선택한와 providerConfigurationInput 일치하는 구성 블록을 하나만 제공합니다. 또는 AWS Secrets Manager에 이미 저장된 보안 암호에 대한 참조를 제공하여 자체 보안 암호를 가져올 수 있습니다.

AWS CLI

다음 예시에서는 Coinbase CDP에 대한 결제 자격 증명 공급자를 생성합니다.

aws bedrock-agentcore-control create-payment-credential-provider \ --name "coinbase-provider" \ --credential-provider-vendor CoinbaseCDP \ --provider-configuration-input '{ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecret": "your-coinbase-api-key-secret", "walletSecret": "your-coinbase-wallet-secret" } }' \ --region us-east-1

다음 예시에서는 AWS Secrets Manager에 저장된 보안 암호를 사용하여 Coinbase CDP 결제 자격 증명 공급자를 생성합니다.

aws bedrock-agentcore-control create-payment-credential-provider \ --name "coinbase-provider" \ --credential-provider-vendor "CoinbaseCDP" \ --provider-configuration-input '{ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecretSource": "EXTERNAL", "apiKeySecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-api-secret", "jsonKey": "apiKeySecret" }, "walletSecretSource": "EXTERNAL", "walletSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-wallet-secret", "jsonKey": "walletSecret" } } }' \ --region us-east-1

다음 예시에서는 Stripe Privy에 대한 결제 자격 증명 공급자를 생성합니다.

aws bedrock-agentcore-control create-payment-credential-provider \ --name "stripe-privy-provider" \ --credential-provider-vendor StripePrivy \ --provider-configuration-input '{ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecret": "your-stripe-privy-app-secret", "authorizationPrivateKey": "your-stripe-privy-authorization-private-key", "authorizationId": "your-stripe-privy-authorization-id" } }' \ --region us-east-1

다음 예시에서는 AWS Secrets Manager에 저장된 보안 암호를 사용하여 Stripe Privy 결제 자격 증명 공급자를 생성합니다.

aws bedrock-agentcore-control create-payment-credential-provider \ --name "stripe-privy-provider" \ --credential-provider-vendor "StripePrivy" \ --provider-configuration-input '{ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecretSource": "EXTERNAL", "appSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-app-secret", "jsonKey": "appSecret" }, "authorizationPrivateKeySource": "EXTERNAL", "authorizationPrivateKeyConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-auth-key-secret", "jsonKey": "authorizationPrivateKey" }, "authorizationId": "your-stripe-privy-authorization-id" } }' \ --region us-east-1
AWS SDK

다음 예제에서는 Coinbase CDP에 대한 공급자를 구성합니다.

import boto3 client = boto3.client("bedrock-agentcore-control", region_name="us-east-1") coinbase_provider = client.create_payment_credential_provider( name="coinbase-provider", credentialProviderVendor="CoinbaseCDP", providerConfigurationInput={ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecret": "your-coinbase-api-key-secret", "walletSecret": "your-coinbase-wallet-secret" } } )

다음 예제에서는 AWS Secrets Manager에 저장된 보안 암호로 Coinbase CDP 공급자를 구성합니다.

import boto3 client = boto3.client("bedrock-agentcore-control", region_name="us-east-1") coinbase_provider = client.create_payment_credential_provider( name="coinbase-provider", credentialProviderVendor="CoinbaseCDP", providerConfigurationInput={ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecretSource": "EXTERNAL", "apiKeySecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-api-secret", "jsonKey": "apiKeySecret" }, "walletSecretSource": "EXTERNAL", "walletSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-wallet-secret", "jsonKey": "walletSecret" } } } )

다음 예제에서는 Stripe Privy에 대한 공급자를 구성합니다.

import boto3 client = boto3.client("bedrock-agentcore-control", region_name="us-east-1") stripe_privy_provider = client.create_payment_credential_provider( name="stripe-privy-provider", credentialProviderVendor="StripePrivy", providerConfigurationInput={ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecret": "your-stripe-privy-app-secret", "authorizationPrivateKey": "your-stripe-privy-authorization-private-key", "authorizationId": "your-stripe-privy-authorization-id" } } )

다음 예제에서는 AWS Secrets Manager에 저장된 보안 암호로 Stripe Privy 공급자를 구성합니다.

import boto3 client = boto3.client("bedrock-agentcore-control", region_name="us-east-1") stripe_privy_provider = client.create_payment_credential_provider( name="stripe-privy-provider", credentialProviderVendor="StripePrivy", providerConfigurationInput={ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecretSource": "EXTERNAL", "appSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-app-secret", "jsonKey": "appSecret" }, "authorizationPrivateKeySource": "EXTERNAL", "authorizationPrivateKeyConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-auth-key-secret", "jsonKey": "authorizationPrivateKey" }, "authorizationId": "your-stripe-privy-authorization-id" } } )
AgentCore SDK

다음 예제에서는 Coinbase CDP에 대한 공급자를 구성합니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client = IdentityClient("us-east-1") coinbase_provider = identity_client.create_payment_credential_provider( name="coinbase-provider", credential_provider_vendor="CoinbaseCDP", provider_configuration_input={ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecret": "your-coinbase-api-key-secret", "walletSecret": "your-coinbase-wallet-secret" } } )

다음 예제에서는 AWS Secrets Manager에 저장된 보안 암호로 Coinbase CDP 공급자를 구성합니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client = IdentityClient("us-east-1") coinbase_provider = identity_client.create_payment_credential_provider( name="coinbase-provider", credential_provider_vendor="CoinbaseCDP", provider_configuration_input={ "coinbaseCdpConfiguration": { "apiKeyId": "your-coinbase-api-key-id", "apiKeySecretSource": "EXTERNAL", "apiKeySecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-api-secret", "jsonKey": "apiKeySecret" }, "walletSecretSource": "EXTERNAL", "walletSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-wallet-secret", "jsonKey": "walletSecret" } } } )

다음 예제에서는 Stripe Privy에 대한 공급자를 구성합니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client = IdentityClient("us-east-1") stripe_privy_provider = identity_client.create_payment_credential_provider( name="stripe-privy-provider", credential_provider_vendor="StripePrivy", provider_configuration_input={ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecret": "your-stripe-privy-app-secret", "authorizationPrivateKey": "your-stripe-privy-authorization-private-key", "authorizationId": "your-stripe-privy-authorization-id" } } )

다음 예제에서는 AWS Secrets Manager에 저장된 보안 암호로 Stripe Privy 공급자를 구성합니다.

from bedrock_agentcore.services.identity import IdentityClient identity_client = IdentityClient("us-east-1") stripe_privy_provider = identity_client.create_payment_credential_provider( name="stripe-privy-provider", credential_provider_vendor="StripePrivy", provider_configuration_input={ "stripePrivyConfiguration": { "appId": "your-stripe-privy-app-id", "appSecretSource": "EXTERNAL", "appSecretConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-app-secret", "jsonKey": "appSecret" }, "authorizationPrivateKeySource": "EXTERNAL", "authorizationPrivateKeyConfig": { "secretId": "arn:aws:secretsmanager:us-east-1:123456789012:secret:my-auth-key-secret", "jsonKey": "authorizationPrivateKey" }, "authorizationId": "your-stripe-privy-authorization-id" } } )