Skip to content

triauth for Amazon CognitoOIDC

Let the people at your domain sign in to every app behind your Cognito user pool with one approval on their own device.

  • Identity and access
  • Cloud service
Sign-in through
OpenID Connect bridge
Available in
Every user pool
Set up in
User pool › Social and external providers

About Amazon Cognito

Amazon Cognito is the sign-in service of AWS. A user pool is a hosted user directory with a login page that apps send their users to, and it can forward the sign-in to an outside identity provider and hand the app its own tokens. The app only ever talks to Cognito.

Connect Amazon Cognito to triauth

A user pool signs people in through the triauth OpenID Connect bridge, as an OpenID Connect identity provider. Once connected, the pool's login page shows a button for it. People at your domain click it, type their username, and approve on their own device, and Cognito signs them into the app. Nobody keeps a password in the pool, and when someone leaves, removing their identity records at your domain ends their access to every app behind it.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste the pool's redirect address, https://example.auth.eu-central-1.amazoncognito.com/oauth2/idpresponse with your own pool domain in place of example.auth.eu-central-1.amazoncognito.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. In the Cognito console, open your user pool, then Social and external providers › Add an identity provider › OpenID Connect, and fill in the fields below with your domain in place of example.com.

    FieldValue
    Provider nametriauth
    Client ID and Client secretfrom the bridge
    Authorized scopesopenid email profile groups
    Attribute request methodGET
    Setup methodAuto fill through issuer URL, with https://oidc.triauth.org/example.com
    Attribute mappingemail from email, email_verified from email_verified, name from name
  3. Open the app client, and under Login pages › Managed login pages configuration add the new identity provider.

  4. Open the app's login page and click the triauth button.

Checkpoint

The pool's login page shows a button for the new provider. Choosing it opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve. Cognito then returns the app its own tokens.

Good to know

  • Everyone with an identity at your domain gets a profile in the pool the first time they sign in, named triauth_ followed by their identifier. To let only one team in, limit the app to a group when you connect it.
  • The groups published at your domain can be mapped to a custom attribute of the pool, as one bracketed list. Cognito's own groups are assigned by your app or a Lambda trigger.
  • People who sign in through an outside provider are counted separately from direct sign-ins in Cognito's pricing, with a free allowance each month.

For the person who connects the app

SettingValue
Redirect addresshttps://<your pool domain>/oauth2/idpresponse, on the prefix domain or on a custom domain
Where in Cognitothe user pool's Social and external providers, then the app client's login pages
IssuerAuto fill through issuer URL with https://oidc.triauth.org/<your domain>. If the path trips it, Manual input takes the four addresses /authorize, /token, /userinfo, and /jwks
Client authenticationCognito keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge
RequirementsHTTPS on port 443, a key ID in the keys and tokens, responses under one megabyte, and a sign-in that finishes within five minutes. The bridge meets them
Identity CenterAWS IAM Identity Center connects identity providers over SAML only, so this page is about Cognito user pools

Cognito's OIDC identity provider guide explains every field and the attribute mapping rules.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.