Table of contents
AWS Cognito could allow you mange user sign-in, sign-up and its management with ease and Strapi is one of the headless CMS with good support on customize own API and allow different OAuth login. And Strapi is able to authenticate with the Cognito service by its Cognito provider.
Setting Up AWS Cognito User Pool
Search Cognito after login aws account. Select "Manage User Pools".
Create a new user pool and select "Review defaults".
The default setting is filled. For this example we will use simple email-password login. You may also select the config to fit your usage. Scroll down you will have a app client session. Select "Add app client" and create a new app client.
After the app client is created, you may now access the app client id and client secret by clicking the show details which will be using later when setting in Strapi.
On the left hand side menu, select "App client settings" below the app integration. Click the app client just created and config with the following setting.
Goto Domain name below the App integration section and select a domain name. And the subdomain will also be used to setting in Strapi later.
After that, go back to the App client settings, you should see the Launch UI option.
Setting Up Strapi Protal
Goto Settings and select Providers.
Click Cognito and set with the following config.
Test Result
Goto browser with the link "localhost:1337/connect/cognito". It should redirect you to the cognito login page. You may sign up a new account or sign in.
After the login is success, it will redirect you to the page like the following.
id_token is the JWT that AWS Cognito returned, which you may use to access AWS's service if neccessary.
The returned json is from Strapi, the jwt inside may use to access Strapi service.