Skip to content

How To Publicly Deploy aws-samples/bedrock-chat (web application) For Public Use Without AWS Sign In To The Bedrock Chat

0

Hi,

I’m working on an e-commerce website and we are using Amazon Bedrock (Agents + Knowledge Bases) as a backend.

Right now we have deployed the aws-samples/bedrock-chat solution (the Bedrock Chat web app) via CDK, so we have a CloudFront URL that shows the chat UI with Cognito login.

Our product requirement is:

  • Website visitors (shoppers) click a button like “AI Size Helper” on our site
  • A popup/iframe opens and shows a chatbot
  • Users should not need to log in with AWS/Cognito
  • The chatbot should talk to one specific Bedrock Agent / Knowledge Base we configure

We understand that:

  • The Bedrock Chat sample uses Amazon Cognito User Pools + Identity Pools + Amplify <Authenticator> and requires a user to log in before the UI loads.
  • We must not put a Cognito username/password directly into HTML/JavaScript or auto-submit the login form, because that would expose credentials and also likely be blocked by cross-origin and browser security rules.
  • Cognito Identity Pools support unauthenticated “guest” identities, but the current frontend seems to be hard-wired to expect User Pool tokens via the Amplify Authenticator.

Because of this, I’m trying to confirm what is officially supported / recommended.

My questions:

  1. Is there any supported way to configure the aws-samples/bedrock-chat frontend so that anonymous “guest” users (no Cognito login) can use a bot?
  2. For example, by using Cognito Identity Pool unauthenticated roles only, or some configuration that bypasses the User Pool login, without forking and rewriting the whole frontend. If the answer is “no”, is the official recommended approach for a public web chatbot something like:
  • a custom frontend (our own HTML/React)
  • calling an Amazon API Gateway + AWS Lambda backend and that Lambda talks to Bedrock Agents / Knowledge Bases using an IAM role? Or is there another AWS-recommended pattern for a public, no-login Bedrock chatbot UI?
  1. Is there any AWS-provided public web-chat UI (for Bedrock) planned or available, similar to the Bedrock Chat app but intended for anonymous/non-AWS end-users?

Security confirmation: Is it correct that:

  • Embedding Bedrock Chat in an iframe on another domain and trying to auto-login with stored credentials in HTML is not supported and is considered insecure / against best practices?
  • The Bedrock Chat solution is intended for internal, authenticated enterprise users, not for direct public embedding?

Context / Constraints:

  • We only want end-users to talk to one specific Agent / KB, not to manage bots or see multiple bots.
  • We’re currently evaluating alternatives like custom UI vs third-party open-source UIs (e.g., Open WebUI + a Bedrock proxy), but we’d like to know the official AWS guidance before committing.

Any clarification on:

  • whether aws-samples/bedrock-chat can ever be safely used as a public chatbot, and
  • what AWS recommends for this “public website chat with Bedrock Agent/KB” scenario

would be really appreciated.

Thank you!

  • AWS Bedrock Chat isn’t built for anonymous use — it’s an authenticated internal tool. For a public chatbot, AWS’s recommended pattern is: Frontend → API Gateway → Lambda → Bedrock Agent/KB. That gives you a safe, no-login experience without exposing credentials, and lets you embed it anywhere (iframe, popup, etc.). There’s no official AWS ‘public chat UI’ yet, so custom UI or a third-party UI + a secure proxy is the right path today.

1 Answer
0

Based on the information available, there isn't a direct way to configure the aws-samples/bedrock-chat frontend for anonymous "guest" users without Cognito login while maintaining the existing architecture.

For your e-commerce website use case where you need a public chatbot without login requirements, the recommended approach would be:

  1. Build a custom frontend (your own HTML/React application)
  2. Create a backend using API Gateway and Lambda that communicates with your specific Bedrock Agent/Knowledge Base using an IAM role
  3. Configure the backend to handle requests from anonymous users

This approach aligns with security best practices as:

  • Embedding Bedrock Chat in an iframe and attempting to auto-login with stored credentials would indeed be insecure
  • The Bedrock Chat sample solution appears to be designed for authenticated enterprise users rather than public embedding

There are examples of building web applications that interact with Amazon Bedrock using similar architectures. For instance, you could create a solution where:

  • Your frontend makes API calls to your backend service
  • Your backend service (Lambda) has the necessary IAM permissions to invoke Bedrock
  • The backend handles all authentication and authorization without requiring end users to authenticate

For your specific requirements (an "AI Size Helper" that opens in a popup/iframe and talks to one specific Bedrock Agent/Knowledge Base), this custom approach would give you the control needed while maintaining security.

There's no indication in the available information about an AWS-provided public web-chat UI specifically designed for anonymous end-users, though AWS does provide various samples and frameworks that could be adapted for this purpose.
Sources
Community | Add Generative AI to a JavaScript Web App ingle page app.
Community | Use Amazon Bedrock and LangChain to build an application to chat with web pages
Community | How to build a Go application to chat with any web page

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.