CrushMFT Documentation

CrushOIDC with Amazon Cognito#

This sets up sign-in through an Amazon Cognito user pool on the login page, with CrushOIDC. A user pool is a directory of users that AWS keeps for you; it can also pass sign-ins on to Google, Facebook or a company directory.

1. The user pool and its app client#

In the AWS console, under Amazon Cognito: use a user pool you have, or make one. In it, make an app client.

Field Give
the kind of client a confidential client, with Generate client secret on
Allowed callback URLs the address of the server ending in /SSO_OIDC/: https://files.example.com/SSO_OIDC/
Allowed sign-out URLs the address of the server
OAuth 2.0 grant types Authorization code grant
OpenID Connect scopes OpenID, and Email and Profile for the address and the name

Note the Client ID and the Client secret of the app client, the User pool ID, and the region the pool is in.

The pool also needs a domain for its sign-in page, under App integration: Cognito's own, or one of yours.

2. Set the plugin#

Setting Value
OpenID Configuration URL https://cognito-idp. + region + .amazonaws.com/ + user pool ID + /.well-known/openid-configuration. For example https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_AbCdEfGhI/.well-known/openid-configuration. Then Fetch Configuration.
Client ID, Client Secret of the app client
Scope openid email profile
Claim as Username email, or cognito:username for the pool's own user name
PKCE?, Verify ID Token? on
Login button text what your users will recognise

and the settings for what the user gets.

If the pool sends neither an address nor a name, the plugin cannot name the user: "Amazon Cognito : Could not found user name info! Missing emails or name from id token!" Make sure the app client may read the attribute you chose, and that the scope asks for it.

3. Groups#

The groups of a user pool arrive in the claim cognito:groups. In OAuth Roles:

cognito:groups=staff : oidc_staff
cognito:groups=partners : oidc_partners

Things to know#

  • Who can get an account is set in the pool. A pool with open sign-up lets anybody register. Turn self sign-up off, or sort people on the server with Username matching and roles.
  • Reject logins if email is unverified is on in a new configuration: keep it, above all with pools where people type their own address.
  • Signing out of Cognito uses the address of the pool's domain, /logout, with the client ID and a sign-out address that is allowed in the app client. Cognito does not use the usual parameters; check the pool's description after Fetch Configuration for an end_session_endpoint, and where there is none, build the address by hand in End Session URL.

Not tried for this page#

Nothing was run against Amazon Cognito: no account there was used. The steps on the provider's side follow the earlier documentation and the provider's console as it is known; names of menus change over time. The plugin's side is from its screen. Try the first setup with one test user, with Debug and Log HTTP Request Calls on.