aws-samples / aws-samples/bedrock-chat

How to disable Cognito User Pool login in aws-samples/bedrock-chat and support anonymous users?

Open
#978 0 comments 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
TypeScript
Stars
1.3k
Forks
535
Avg merge
1d 12h
Merged PRs (30d)
10

Description

Hi, we deployed the aws-samples/bedrock-chat application using CDK.
It works, but the frontend always forces the user to authenticate using the Amplify (Cognito Hosted UI).

For our use case (public e-commerce website), we need:

- End-users not to log in
- A single Bedrock Agent/KB is used behind the scenes
- The chat UI of the bedrock web aapp should load immediately without showing the Cognito login

We tried:
- Auto-fill username/password using value="xxx"
- Injecting credentials with JavaScript
- Using Cognito Identity Pool unauthenticated role
- postMessage to iframe
- Embedding the chat UI on another domain (the aws bedrock chat is just inside an iframe)

But the frontend blocks everything because:
- requires User Pool tokens, not Identity Pool tokens
- The Cognito Hosted UI is cross-origin, so we cannot modify inputs
- The Bedrock Chat SPA refuses to render unless authStatus === "authenticated"
- CloudFront domain is different from our website domain, so iframe access is blocked

My questions:

Q1 — Is there an official or supported configuration to run Bedrock Chat WITHOUT Cognito User Pool login?
(i.e., allow anonymous users or use Identity Pool only)

Q2 — Can the frontend be configured to skip entirely, or is login mandatory?

Q3 — If not possible, is AWS’s recommended path to build a custom frontend → API Gateway → Lambda → Bedrock?

Q4 — Is the Bedrock Chat sample intentionally designed only for internal authenticated environments?

Thanks in advance.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the frontend's Amplify Authenticator and the authStatus check, then review the CDK configuration for Cognito User Pools and Identity Pools. Compare the sample's documented authentication flow with the requested anonymous-user flow and determine whether a supported configuration exists; the issue does not define an implementation or test target.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, react, typescript
Domain
ai, authentication, cloud, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.