Appearance
Amazon Cognito authentication
Amazon Cognito authentication lets your users sign in through a Cognito user pool you manage in AWS. Once connected, you can offer “Continue with Cognito” in your WeWeb app.
What this integration supports
- Social sign in through a Cognito user pool (Hosted UI)
- Redirect to different pages for success, error, and first-time users
Setup in the AWS console
You will create (or use) a Cognito user pool, then register WeWeb’s callback URL in your app client settings.
1. Create a user pool and an app client
- Open the Amazon Cognito console.
- Create a
User pool(or select an existing one). - Create an
App clientfor your WeWeb project. - Copy the:
Client IDClient secret(If your app client uses one)
2. Configure a hosted UI domain
In your user pool, configure a domain for the hosted UI. This is the domain Cognito uses for sign in, for example:
https://<your-domain>.auth.<region>.amazoncognito.com
You will use this value as Cognito Domain URL in WeWeb.
3. Add your callback URL
In your app client settings:
- Enable the OAuth flow for web sign in:
- Allowed OAuth flows:
Authorization code grant - Allowed OAuth scopes:
openid,profile,email
- Allowed OAuth flows:
- Add the callback URL:
https://<your-domain>/api/auth/callback/cognito
If you use multiple environments, add a callback URL for each environment (preview, staging, production).
Connect Amazon Cognito in WeWeb
- In the WeWeb editor, go to
Data & API → Auth → Integrating providers. - Find
Amazon Cognitoand expand it. - Turn on the
Enabletoggle. - Fill in:
Client IDClient SecretCognito Domain URL— For examplehttps://<your-domain>.auth.<region>.amazoncognito.com
- Click
Save.
WeWeb stores these values as environment variables (for example PROVIDER_COGNITO_CLIENT_ID, PROVIDER_COGNITO_CLIENT_SECRET, PROVIDER_COGNITO_ISSUER).
Test sign in
- In
Interface, add a “Continue with Cognito” button. - Create a workflow on click and add
Sign in with social provider. - Set:
Provider:cognitoSuccess page,Error page, And (optional)New user page
- Preview your project and complete the Cognito sign-in flow.
For what to do after sign in (roles, private pages, and access checks), see Users and roles overview →.
Common pitfalls
Callback URL mismatch
If Cognito shows a callback or redirect error, the callback URL in your app client settings is usually wrong.
- In Cognito, confirm the callback URL exactly matches
https://for the environment you are testing./api/auth/callback/cognito - Make sure you are not mixing preview and production domains.
Wrong Cognito domain URL
If the sign in page can’t load or you see “issuer” / “domain” errors, double-check the domain value you pasted into WeWeb.
- Use the hosted UI domain from your user pool (it usually ends with
.amazoncognito.com). - Include
https://inCognito Domain URL.
OAuth flow or scopes not enabled
If Cognito blocks the sign in flow, your app client may not be configured for the authorization code flow.
- Enable
Authorization code grantin your app client. - Enable
openid,profile, andemailscopes.
Reference
WeWeb settings
| Setting in WeWeb | Description | Where to find it in AWS |
|---|---|---|
Client ID | Identifies your Cognito app client. | User pool → App client. |
Client Secret | Secret used to securely complete sign in. | User pool → App client (if enabled). |
Cognito Domain URL | Hosted UI domain used for sign in (issuer). | User pool → Domain (hosted UI domain). |
FAQs
What provider value should I use in the workflow action?
Use cognito as the Provider value in the Sign in with social provider action.
Do I need a user pool or an identity pool?
Use a user pool. This provider is for signing in users through the user pool hosted UI.
Can I use different user pools per environment?
Yes. Configure different Client ID, Client Secret, and Cognito Domain URL values per WeWeb environment.
Continue learning
Now that users can sign in, learn how to control access with roles and protected pages.

