End-user login to Strapi with AWS Cognito: what the integration does
Your front-end users already sign in through Cognito, and Strapi needs to accept those sessions without creating a second login system. This section sets the boundary for the work: a Cognito user pool issues identities and tokens, and Strapi's Users & Permissions plugin decides what an authenticated end user can read and write through the content API. Those are two separate jobs, and the integration succeeds only when both are designed together. Do not confuse this with admin SSO. Strapi's SSO feature covers administrator login to the admin panel through an identity provider, and it does not govern the people who use your public or member-facing front end. End-user authentication is handled by the Users & Permissions plugin, and the supported route into Cognito is its provider mechanism.
Before you plan field values, confirm the current Cognito provider documentation in Strapi's docs for your Strapi version, since provider configuration, the names of settings and the packages involved can change between releases. Treat any package name or configuration key you find in older blog posts as unverified until it is checked against the docs and a test instance. The same applies to how Strapi expects the token it receives from Cognito to be validated and how it creates or matches a Strapi user record on first sign-in. Ask your implementation partner or internal platform team to write down the Strapi version, the provider approach and the exact fields in a short design note before any configuration begins.
The practical decisions sit on both sides of the boundary. On the Cognito side, you decide which user pool holds front-end users, which app client the front end uses, and which attributes Strapi needs. On the Strapi side, you decide the default role for new end users, which content those roles can read, and whether a Cognito account that signs in should map to exactly one Strapi user. Plan for a test pool with sample users, record who owns each setting, and agree how Cognito user changes such as disabled accounts or password resets will reach Strapi. Without those answers, the sign-in may work in a demo and still expose the wrong content in production.
What you need before configuring Cognito in Strapi
Before you touch the Cognito console or Strapi's Users & Permissions settings, confirm the Strapi version, database, Node.js runtime, public address and front end. Each of these shapes the callback design and the work that follows, so settle them first.
Target Strapi 5, not v4
Strapi v4 reached end of life on April 30, 2026, and its final release will receive no further updates. Plan the Cognito provider against Strapi 5, since the Users & Permissions setup and response handling you build now should not have to be redone during a later upgrade. If you run v4 today, treat the version move as a separate workstream that comes before this configuration. Confirm the exact Strapi 5 minor version you will pin before you write any provider code.
Strapi v4 to v5 docsSupported database
Strapi 5 supports PostgreSQL 14 or later, MySQL 8.0 or later, MariaDB 10.3 or later and SQLite 3. It does not support MongoDB or other NoSQL databases. Choose one of the supported engines and confirm the version your hosting team will run. SQLite suits local evaluation rather than a production user base. Users created through Cognito are stored in this database, so the choice also affects backup and restore planning.
Strapi installation requirementsNode.js on an LTS release
Strapi 5 runs only on Active or Maintenance LTS Node.js versions. Check the current Strapi installation requirements against the Node.js release schedule your platform team uses, and pin that version in your build image. An unsupported runtime tends to surface as a failed build or startup error, not as a clear authentication fault, so verify it before debugging the Cognito flow.
Public HTTPS address for callbacks
Cognito redirects users back to Strapi at a callback URL that must match the app client configuration exactly. That address must be reachable over HTTPS from the browser, including for local tests, so decide the production and staging hostnames now. Confirm who owns DNS and certificates, and whether a reverse proxy or load balancer sits in front of Strapi, because forwarded headers can change the URL Strapi generates.
AWS rights for user pools and domains
Someone must be able to create a Cognito user pool, an app client and a hosted UI domain in the target AWS account and Region. Confirm which team owns those resources, whether infrastructure is managed as code, and who approves changes to the app client. Agree on a naming convention and a separate pool per environment before the first deployment, so staging users never reach production.
A front end that calls Strapi
End-user login is only useful when a front end sends the user through Cognito and then uses the token Strapi returns. Identify the framework, where it runs, and how it stores and sends tokens to Strapi. Decide which pages require sign-in and who writes that code. Plan this work alongside the Strapi configuration so the callback route and the token handling are tested together.
How a Cognito login reaches Strapi Users & Permissions
The flow starts in the browser, where the front end sends the editor or end user to the Cognito hosted sign-in page through the user pool domain. After authentication, Cognito returns the browser to the registered callback URL with an authorization result. The front end hands that result to Strapi, which validates it with the provider and issues Strapi's own JWT, and the front end then calls Strapi APIs with that token. Verify the exact exchange step against the current AWS Cognito and Strapi provider documentation before finalizing the diagram, because the handoff details depend on the flow type and provider configuration you choose.
Browser, Cognito and Strapi trust boundaries in the end-user sign-in flow.
Configuring end-user login to Strapi with AWS Cognito, step by step
This sequence takes a Cognito user pool from creation to a working end-user sign-in in Strapi Users & Permissions, with a check at each stage so the team knows which layer is failing if something breaks.
Create or select the user pool
Confirm which Cognito user pool will hold end users, and whether it is dedicated to the Strapi front end or shared with other applications. Record the user pool ID and AWS region, since Strapi's provider settings and the issuer URL depend on both. Review the sign-in options, required attributes and password policy with the security team before any app client exists, because changing them later can affect existing users. Done when the pool ID and region are written down and the attributes Strapi will read, such as email, are present in the pool's schema.
Configure the Cognito domain
In the user pool, set up a hosted UI domain, either a Cognito-prefixed domain or a custom domain with a certificate in the required region. The domain forms the base of the authorize, token and logout endpoints that the Strapi front end and the Strapi server will call. Note the full domain, since a typo here produces errors that look like provider failures. Done when opening the hosted sign-in page for the domain in a browser shows the Cognito login screen for a test user.
Create the app client with the correct type and OAuth settings
Create an app client for the Strapi integration. Choose the client type based on how the flow is built: a confidential client holds a client secret that only the Strapi server uses, which suits server-side token exchange, while a public client has no secret and relies on PKCE in the browser. Enable the authorization code grant, select the OpenID Connect scopes that include email and profile, and confirm which identity providers the client may use. Record the client ID and, for a confidential client, the secret. Done when the app client shows the chosen flow, scopes and providers in its settings and the client ID is recorded.
Register callback and sign-out URLs
Add the exact callback URL that Strapi's Users & Permissions provider will return to, which follows the Strapi server's public address and the provider path that Strapi exposes, and add the sign-out URL of the front end. Match scheme, host, port and trailing slash exactly, because Cognito rejects any mismatch. Test with a local and a deployed hostname if both will be used, and list each one separately. Done when a sign-in attempt from the hosted UI returns to the registered callback without a redirect_mismatch error.
Enable the Cognito provider in Users & Permissions
In the Strapi admin panel, open Settings, then Users & Permissions plugin, then Providers, and enable the Cognito provider. Enter the user pool region or subdomain, the app client ID and, for a confidential client, the client secret, following the field names shown in the provider form of your Strapi version. Store the secret in environment variables rather than in the database-backed settings where your deployment allows it. Save, then restart the server if the provider change requires it. Done when the provider shows as enabled and the server starts without configuration errors in its logs.
Set public permissions and the default role for new users
Under Users & Permissions, set the default role that Strapi assigns to a user created by the first Cognito sign-in, and review the public role so unauthenticated visitors receive only the endpoints they need. Confirm that the authenticated role grants only the content and actions end users should reach. Decide whether a Cognito sign-in creates a new Strapi user automatically or only links to an existing one, because this controls who can enter. Done when a test account with no prior Strapi record can complete sign-in and lands with the default role shown on its user record.
Test the sign-in end to end
Run a sign-in from the front end with a test Cognito user. Check that the browser is redirected to the hosted UI, returns to the callback, and that the Strapi server exchanges the code for tokens and returns a Strapi JWT. Call an authenticated endpoint with that JWT to confirm it is accepted, and fetch the matching user record in the Strapi admin panel to confirm the email, username and role mapped correctly. Repeat with a user who already exists in Strapi to confirm linking behaves as intended. Done when both test users sign in, the JWT authorizes a protected request, and the user records match the Cognito identity.
How Cognito users map to Strapi users
This table compares each Cognito identity attribute with the Strapi user field it would populate, and how that field behaves on first login. Read it as a checklist: confirm each row against the Users & Permissions provider behavior in your target Strapi version before you write the mapping. The main takeaway is that the email and username choices decide whether a returning user is matched to an existing account or a duplicate is created.
| Identity item | Typical Strapi field | What to confirm before build |
|---|---|---|
| Cognito subject (sub) | Provider identifier stored on the Strapi user record | Confirm whether your Strapi version stores the provider user ID and which field carries it, since sub is the stable key |
| Email attribute | Confirm whether the provider requires a verified email and how Strapi handles an unverified or changed address | |
| Username attribute | username | Confirm whether Cognito username or preferred_username is used, and how collisions with existing Strapi usernames are resolved |
| Duplicate email on first login | Existing user matched or login rejected | Test a user who already exists with the same email from another provider or local login, and record the outcome |
| Default role for new end users | Authenticated role (or your custom role) | Confirm the default role assigned on creation and the permissions it grants on each content type |
| Cognito groups | Custom mapping, if needed | Strapi does not map groups by default in most setups, so confirm whether a custom controller or policy is required for group-based roles |
| Attributes missing from the token | Account creation fails or fields stay empty | Confirm which attributes are requested in the app client scopes and how Strapi reacts when one is absent |
Admin SSO and end-user login are separate in Strapi
Editors, reviewers and developers who work in the Strapi admin panel sign in through the admin authentication flow. Strapi's SSO feature covers this path only. It connects the admin panel to a corporate identity provider, can auto-register new administrators, assigns a default role and can optionally lock out local admin login. Nothing in this path touches the people who read your content on the public site or app.
- Scope: SSO governs administrator login to the admin panel, not end-user accounts.
- Plan requirement: SSO is an add-on for the Growth self-hosted plan and included in Enterprise.
- Provider setup: Provider-specific steps are covered on the sibling admin SSO pages for Microsoft Entra ID, Okta, Keycloak and Google Workspace. Follow those rather than repeating them here.
- Roles: Default role assignment and admin role design are handled in Strapi itself, separately from the identity provider.
- Local login: Decide whether to keep local admin accounts as a break-glass path before enabling lock-out.
Confirm with your team which identity provider the editors already use and whether your self-hosted plan includes SSO before you plan the admin side.
End users of your website or application sign in through the Users and Permissions plugin, which is separate from admin SSO. For a Cognito integration, this plugin is configured with an OAuth or OIDC provider, and Strapi issues its own JWT after the login completes. Your front end then sends that token with API requests, and the permissions on the Users and Permissions role decide what each user can read or write.
- Provider model: Cognito is connected as a provider for Users and Permissions, not as an admin SSO connection.
- Token flow: Strapi returns a JWT that your front end stores and sends with each request, so token handling is part of the design.
- Permissions: Public and authenticated role permissions control access to content types and actions.
- Plan independence: This path does not require the SSO add-on, so the Growth or Enterprise decision does not block it.
- Front-end routing: Callback URLs and redirect handling must match the front end you deploy.
Confirm which user groups need access to which content and whether your front end will hold the token in a way your security team accepts.
Plan choice affects admin login features, but the end-user Cognito integration is planned on its own track. Strapi's self-hosted pricing lists Community as free with unlimited users, Growth at 45 US dollars per month including 3 users with 15 dollars per extra user, and Enterprise at custom pricing. All plans include REST and GraphQL APIs. Audit logs and review workflows are Enterprise features, and content history and releases start at Growth.
- Community: Free, with unlimited users and the Users and Permissions plugin available for end-user login.
- Growth: Lists at 45 US dollars per month including 3 users, with SSO as an add-on.
- Enterprise: Custom pricing, with SSO included and audit logs available.
- Cost driver: Admin user count and whether you need SSO or audit logs, not the number of end users.
- Quote question: Ask the vendor which features apply to your deployment and how end-user counts are treated.
Check the current Strapi self-hosted pricing page before budgeting, since listed prices can change.
Because the two login paths use different configuration and different accounts, verification and ownership should be assigned per path. Test admin SSO with an editor account and end-user login with a test Cognito user, and confirm that a failure in one path does not disable the other. Record who owns each identity provider configuration, its callback URLs and its role mappings.
- Separate test cases: Run admin login and end-user login as distinct test scenarios with distinct accounts.
- Ownership record: Name the team that owns the Cognito user pool and the team that owns admin SSO.
- Lockout risk: Confirm a recovery path for administrators before enabling any local login lock-out.
- Change control: Treat callback URL and provider changes as production changes with a rollback plan.
- Audit evidence: Ask whether your plan provides audit logs for admin actions and plan the evidence you need.
Confirm these owners and test steps with your security and identity teams before go-live.
What the front end receives after a Cognito sign-in
The Cognito tokens stay with the provider exchange. When a user signs in through Cognito, the Users & Permissions provider flow redirects back to Strapi with an authorization code, Strapi exchanges that code with Cognito on the server, and then Strapi issues its own JWT to the front end. The front end never receives a Cognito ID token, access token or refresh token as a credential for Strapi. Your front end should store only the Strapi JWT returned by the callback and send it in the Authorization header on calls to the Strapi REST or GraphQL API. Confirm the exact callback response shape for your Strapi version in your own test environment before you write the front-end code against it.
Token lifetime and refresh behavior are set in Strapi, not in Cognito. Cognito's token lifetimes govern the provider session only, so changing them in the user pool does not change how long a Strapi JWT stays valid. Decide with your security team how long a Strapi JWT should live, whether it should be refreshed, and where it is stored, then configure those settings in Strapi and test expiry directly. The sibling page on Strapi JWT refresh tokens and session management covers those lifetime choices, so use it for the decision rather than repeating it here.
On the front end, plan four behaviors. Store the Strapi token in the place your threat model allows, handle a 401 response by sending the user back to sign-in instead of retrying silently, sign out by clearing the stored Strapi token and, where your design requires it, ending the Cognito session through its logout endpoint, and never accept a Cognito access token as proof of identity in your own API calls. Test each path, including expiry in the middle of an edit, because an editor who loses a session mid-change needs a clear outcome.
Securing the Cognito app client and Strapi permissions
The Cognito app client, the user pool policies and Strapi's Users & Permissions settings each decide who can reach protected content. Review them together, because a loose setting in one place can undo a careful setting in another. The cards below cover the items to check before the integration goes live.
Choose public or confidential client
A confidential client holds a client secret, which suits a server-side Strapi flow where the secret stays on the server. A public client has no secret and fits browser or mobile apps that cannot keep one safe. Confirm which flow your front end uses before you create the app client, because the choice changes how the secret is handled. Store any client secret in the deployment's secret store, never in the repository or in front-end bundles.
Allowlist callback and sign-out URLs
Cognito redirects users to the callback and sign-out URLs you register on the app client, so each entry should be an exact address for your Strapi and front-end environments. Avoid wildcards and leftover localhost entries in production. Check that the sign-out URL matches a page you actually serve, since a loose entry can send users to an unintended destination after logout.
Restrict OAuth scopes
Enable only the OAuth scopes the integration needs, such as openid, email and profile, and leave out broader or custom scopes unless a specific endpoint requires them. Confirm which claims Strapi reads from the token, because the mapped Strapi user depends on those claims. Review the scope list whenever the app client changes so new permissions do not appear silently.
Set password and recovery policies
The user pool sets password complexity, temporary password handling and account recovery options that apply to every end user, including those who sign in through Strapi. Decide whether self-service sign-up is allowed, who can confirm new accounts, and how recovery codes reach users. Ask your identity team to confirm these settings in the pool itself, since the Strapi plugin does not override them.
Decide the MFA requirement
Choose whether multi-factor authentication is optional, required for all users or required only for some groups. Cognito's options vary with the pool's configuration, so confirm the exact MFA modes available for your pool tier and region. Where content includes personal or regulated data, the stronger setting is usually the easier one to justify in a security review.
Lock down Strapi public permissions
In the Users & Permissions plugin, the Public role controls what anonymous visitors can call. Set public access to none for protected content types, then grant the Authenticated role only the find, findOne and write actions each type needs. Test the API as an anonymous request and as a request with a token from an unrelated user, since a public permission is the most common path to unintended data exposure.
Why Cognito logins to Strapi fail and how to fix them
This table lists the failures most often seen when a Cognito user pool is wired to Strapi Users & Permissions, with the likely cause and the first check for each. Work down the rows in order, because callback, domain and secret problems block sign-in before any account mapping or permission issue can appear.
| Failure | Likely cause | First check |
|---|---|---|
| Callback URL mismatch | The callback URL registered on the Cognito app client does not match the URL Strapi sends, often because of a trailing slash, http versus https, or a different host name. | Compare the callback URL in the app client settings with the exact redirect URL the Strapi provider sends, character by character. |
| Wrong domain or region | The Cognito hosted UI domain or the user pool region in Strapi settings points at another pool or region than the one that issued the login. | Confirm the pool ID, region and hosted UI domain in the Cognito console and copy them directly into the Strapi provider fields. |
| Client secret mismatch | The Strapi provider uses a client secret that belongs to a different app client, was rotated, or was pasted with extra whitespace. | Check that the app client ID and secret in Strapi come from the same app client in the same user pool. |
| Signed in to Cognito but no Strapi account | The user authenticated, but Strapi did not create or match a Users & Permissions record, usually because registration or the default role is not set for the provider. | Look for the new user in the Strapi content manager and confirm the provider's registration and default role settings are enabled. |
| Email conflict with an existing Strapi user | A Strapi user with the same email already exists from a different login method, so the provider cannot create a second account with that address. | Search Strapi users by email and decide whether to link the accounts, rename one, or clear the old record before retrying. |
| 403 after login | Sign-in worked, but the Authenticated role in Strapi does not grant access to the content types or routes the front end requests. | Open Settings, Users & Permissions, Roles, then Authenticated, and check the permissions for each endpoint the front end calls. |
| Mixed content or HTTP callbacks behind a reverse proxy | Strapi generates http callback URLs because the proxy does not forward the original scheme and host, so the browser blocks or rejects the redirect. | Confirm the proxy forwards the original protocol and host headers and that the public URL in Strapi uses https. |
How to test the login path before go-live
Test the Cognito login path as a set of user journeys, not a single successful sign-in. The first check is that each user group can sign in and sign out, and that the Strapi user record and role match what that group should be able to reach. Run this for every group that the Cognito app client and the Users & Permissions default role will serve, including the group that should receive no content permissions at all. A user with no permissions should sign in successfully and then be refused on every protected endpoint, which confirms that authentication and authorization are separate decisions in your setup.
Cover the lifecycle cases next. Test first-login account creation for a new Cognito user, then a returning user who signs in again and must map to the same Strapi record rather than a duplicate. Exercise an expired session, a revoked session, and a token that has been tampered with or issued by a different pool. Simulate a failed callback by using a wrong redirect URL or cancelling the hosted sign-in, and confirm the front end handles the error without exposing tokens or stack traces. Finally, send anonymous requests to every protected endpoint and confirm they are refused. Confirm the exact token lifetimes and session behavior for your Strapi version in its documentation, since these values depend on your configuration rather than on defaults you can assume.
Check the logs and the user record after each run. Confirm that the exchange appears in your reverse proxy and Strapi logs without tokens, authorization codes or client secrets, and that the Strapi user record holds the expected identifier and role. Use a separate Cognito user pool and app client for testing so that test users never mix with production identities, and so that a test run cannot create, change or delete a real account. Keep the test pool's callback URLs limited to the test hostnames, and document who may create test users and how they are removed.
What end-user login to Strapi with AWS Cognito costs and takes
What drives the cost of connecting Cognito to Strapi?
The effort depends mainly on how many user groups you have, how many custom attributes must map into Strapi user fields, and how much front-end work the login flow needs. A single pool with one app client and a standard sign-in flow is a much smaller job than several pools, group-based access rules and custom attributes that feed Strapi roles or content permissions. Each of these adds design decisions, configuration and testing. No fee or duration is given here. A quote follows a written scope that lists the pools, groups, attributes, clients and front-end changes involved.
Can our in-house team set up Cognito login for Strapi themselves?
A team with working Strapi and AWS skills can usually do it, provided someone owns the Cognito pool design and the Strapi Users & Permissions configuration. The hard parts are less about clicking through settings and more about deciding how Cognito users map to Strapi users, which app client and callback URLs to use, and how tokens reach the front end. Check whether your team has run a Cognito user pool with an app client before, has tested a Strapi provider flow end to end, and can staff testing with several test users. If any of those are missing, a fixed-scope engagement can cover the gap.
What do we need to provide before the work starts?
The work needs access to the AWS account that will hold the user pool, plus a decision on the pool design before configuration begins. Expect to provide:
- Access to the AWS account or a delegated role with permission to manage Cognito user pools, app clients and domains
- A decision on pool structure, including whether one pool serves all front ends and which attributes users have
- The callback and sign-out addresses for each environment, such as development, staging and production
- A set of test users covering each group and role you plan to use
- The Strapi environments, versions and hosting details the provider will connect to
Which Cognito settings should engineers confirm first?
Start with the app client type, the hosted domain and the callback URLs, because a mismatch in any of them causes sign-in failures that look like Strapi errors. Confirm whether the client carries a secret, since the Strapi provider settings must match that choice. Check that the callback URLs match exactly, including scheme, host and path, for every environment. Then confirm the attributes Cognito returns in the token and how they map to the Strapi user's username and email. Verify the exact field names and allowed values against the Cognito and Strapi documentation for the versions you run, because they change between releases.
What is one-time work and what recurs after launch?
Pool design, app client setup, provider configuration, mapping and testing are one-time work. Recurring work follows the systems in the chain. Client secrets need rotation on a schedule your security policy sets, and each rotation must be applied to Strapi settings in every environment. Strapi and Cognito changes need periodic review, because a Strapi upgrade can change how providers or user fields behave. Keep a record of callback URLs and attribute mappings so future changes are traceable. Ongoing support, upgrades and testing can be run as a retainer after the initial build.
Does Cognito login for Strapi need a paid Strapi plan?
Users & Permissions authentication for end users is part of the Strapi project itself, and it is separate from admin SSO. The self-hosted pricing page lists SSO as an add-on for the Growth plan and as included in Enterprise, but that applies to administrator login to the admin panel, not to end-user providers. Confirm your edition and license terms against the Strapi LICENSE file and the current pricing page before you decide, because licensing questions depend on which code you use.
Who is responsible if login breaks after go-live?
Responsibility should be written into the scope before work starts. Typical splits assign AWS account administration, pool changes and secret rotation to your cloud or identity team, and Strapi configuration, custom code and front-end changes to whoever owns the application. DeployOpen plans, implements, documents and supports self-hosted open-source platforms in infrastructure you control, so the ownership split can follow your own operating model. Agree on who receives alerts, who approves pool changes and how incidents are escalated, and record it in the written scope.
How do we get a quote for this work?
A quote follows from a written scope, and DeployOpen does not publish a price list. Most engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. To prepare a useful request, list the number of user pools and app clients, the groups and attributes that must map into Strapi, the front ends that call the API, the environments you need, and the testing you expect. Ask the provider to show which items are one-time and which are retainer work, and what you must supply.
How DeployOpen scopes and delivers this Strapi integration
DeployOpen plans the Cognito user pool, app client and Strapi Users & Permissions configuration together, then builds and tests the login flow in your own infrastructure. Each engagement starts from a written scope, so your security, identity and editorial teams know exactly what gets configured and what evidence they receive.
How we scope
- Confirm which Cognito user pool, app client and domain the Strapi front end and API will use
- Agree callback and sign-out URLs for each environment before any configuration starts
- Document how Cognito users map to Strapi users, including default role and account linking rules
How we build
- Configure the Cognito app client settings and the Users & Permissions provider in a non-production Strapi instance first
- Test sign-in, token validation, token expiry and account creation against each environment's redirect URLs
- Review Users & Permissions public permissions and token handling so Cognito login does not widen access
How we hand over
- Deliver a written runbook covering Cognito settings, Strapi provider configuration and environment variables
- Provide test results for sign-in, sign-out, role assignment and denied access cases
- Walk your identity and platform teams through the configuration so they can review and change it safely
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts
- Ongoing support, upgrades and continuous testing are available as a retainer after handover
- Ask for a quote based on the written scope, which covers environments, identity sources and testing depth

