MediumHow to enable a temporary sign-in page for free for your staging website with AWS Cognito | by Gireesh Kumar E | Medium
Sitemap
Gireesh Kumar E

Gireesh Kumar E

How to enable a temporary sign-in page for free for your staging website with AWS Cognito

3 min readAug 1, 2026

If your workloads are running on AWS and you need to protect only the devlopment website behind a login page which only the developers/QAs and key people to access this document will guide you how to setup that via AWS cognito.

In the sample architecture, our Prod and development environment are in same AWS account and we are using a common ALB for both infra that deployed on to another VPC.

Press enter or click to view image in full size

Scenario: The live website should be accessible to every end users, so there is no point in developing and maintaining an auth setup for the staging/ dev site and the dev version shoud be protected and new users should be easily onboarded to the dev/staging access at low or no cost.

The easy solution is to use AWS Cognito. So no user management at the host level, no drift between your stage / prod infra setup. What extra is needed? an additional pre-routing rule on the ALB for the staging URL.

Get Gireesh Kumar E’s stories in your inbox

Join Medium for free to get updates from this writer.

Amazon Cognito helps you implement secure sign-in and access control for users, AI agents, and microservices in minutes. The pricing details can be accessed from here. On free-tier 10000 MAU (monthly active user) is free. For a staging website you never going to hit this limit.

The setup details

  1. Create a cognito user pool, The key thing to note here is the return URL, it must be your staging website and also consider to uncheck “Self-registration” as it will be checked by default (you don’t want the public to self sign-in to your staging domain)
Press enter or click to view image in full size

2. Once the user pool is created select the user pool and go to the app client section for further configuration. Click on edit and enable the password based authentication.

Press enter or click to view image in full size

3. Now you can add the required users on to the cognito user pool. (Option available on the user management section inside the user pool.

Press enter or click to view image in full size

4. Now let’s go to the ALB and add the required rule there to enable the authentication. — Add a prerouting action to the existing DEV ALB rule.

Press enter or click to view image in full size

5. Once it is enabled, if we tried accessing the staging URL first the cognito sign-in page will be displayed:

Press enter or click to view image in full size

Only after successful login — the actual webiste will be loaded.

--

--