Add harness sample: JWT inbound auth + OAuth-protected gateway (Issue #1397)#1398
Merged
evandrofranco merged 3 commits intoawslabs:mainfrom Apr 24, 2026
Merged
Add harness sample: JWT inbound auth + OAuth-protected gateway (Issue #1397)#1398evandrofranco merged 3 commits intoawslabs:mainfrom
evandrofranco merged 3 commits intoawslabs:mainfrom
Conversation
auth and OAuth-protected gateway outbound auth. Architecture: - User Auth Pool (Cognito, USER_PASSWORD_AUTH) for harness inbound auth - M2M Pool (Cognito, client_credentials) for gateway outbound auth - OAuth2 credential provider in AgentCore Identity - Lambda target behind AgentCore Gateway with GATEWAY_IAM_ROLE - harness with CUSTOM_JWT inbound + outboundAuth.oauth to gateway Files: - harness_oauth_gateway.ipynb — main notebook (25 cells) - utils/setup_helpers.py — idempotent infra setup and cleanup functions - utils/lambda_function_code.py — order management Lambda handler - images/architecture.jpg — architecture diagram All setup is idempotent and re-runnable. Cleanup discovers resources by name and skips gracefully if not found.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a sample notebook demonstrating AgentCore harness with end-to-end OAuth:
CUSTOM_JWTon the harness, backed by a Cognito user pooloutboundAuth.oauthwithCLIENT_CREDENTIALSgrant to anAgentCore Gateway, via an OAuth2 credential provider in AgentCore Identity
Architecture:
Files:
All setup is idempotent and re-runnable. Cleanup discovers resources by name and skips gracefully if not found.
Amazon Bedrock AgentCore Samples Pull Request
Important
review readylabel to it. Only PRs withreview readywill be reviewed.Issue number: 1397
Concise description of the PR
Adds a new sample notebook for AgentCore harness with JWT inbound auth and
OAuth-protected gateway outbound auth, because there is no existing sample
showing the end-to-end CUSTOM_JWT + outboundAuth.oauth pattern with two
Cognito pools (user auth + M2M client credentials).
User experience
Before: No sample exists for harness OAuth inbound/outbound auth.
Developers must piece together docs for harness, gateway, identity, and
Cognito to wire up JWT-protected agent invocation with OAuth-protected
tool calls.
After: A single notebook walks through the full auth chain — from
creating Cognito pools, to configuring CUSTOM_JWT on the harness, to
invoking with a bearer token and watching the harness automatically
fetch M2M tokens for the gateway. All infra setup is in helper functions;
the notebook focuses on the harness auth config. Everything is idempotent
and includes cleanup.
Checklist
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.