Skip to content

Add harness sample: JWT inbound auth + OAuth-protected gateway #1397

@dhegde-aws

Description

@dhegde-aws

Summary

Add a sample notebook demonstrating AgentCore harness with end-to-end OAuth integration:

  • Inbound auth: CUSTOM_JWT authorizer on the harness (Cognito user pool, USER_PASSWORD_AUTH)
  • Outbound auth: OAuth client credentials grant to authenticate to an AgentCore Gateway via a credential provider in AgentCore Identity

What the sample covers

  • Configuring authorizerConfiguration.customJWTAuthorizer on a harness
  • Configuring outboundAuth.oauth on a gateway tool with CLIENT_CREDENTIALS grant
  • Registering an OAuth2 credential provider in AgentCore Identity
  • Creating a Gateway with CUSTOM_JWT inbound auth and a Lambda target
  • Invoking the harness with a bearer token via the HTTPS endpoint
  • Full cleanup (discover-by-name, idempotent)

Files

  • harness_oauth_gateway.ipynb — main notebook (focused on harness auth)
  • utils/setup_helpers.py — idempotent infra setup functions (Cognito, Lambda, Gateway, IAM)
  • utils/lambda_function_code.py — order management Lambda handler
  • images/architecture.jpg — architecture diagram

Proposed location

[agentcore-samples] - [01-tutorials] - [11-AgentCore-harness] - [01-advanced-examples] - [07-oauth]

Metadata

Metadata

Assignees

Labels

01-tutorials01-tutorialsbugCode isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions