Step by Step guide to setup single sign-on into WordPress using AWS cognito with OpenId Connect protocol

Step by Step guide to configure AWS Cognito as an OAuth/OpenId Connect Server

  1. Go to https://console.aws.amazon.com/console/home and sign up/login in your account to Configure AWS Cognito.
  2. Login to Amazon Console

  3. Search for Cognito in the AWS Services search bar as shown below.
  4. Search for AWS Cognito

  5. Click on Mange User Pools button to see the list of your user pools.
  6. AWS Cognito User Pools

  7. Click on Create a user pool to create a new user pool.
  8. Create New AWS Cognito Pool

  9. Add a Pool Name and click on the Review Defaults button to continue.
  10. Name your AWS Cognito User Pool

  11. Scroll down and click on the Add App Client option in front of App Clients.
  12. AWS Cognito App Client

  13. Click on Add an App Client. Enter an App Client Name and click on Create app client to create an App client.
  14. Create App Client

  15. Click on Return to Pool Details to come back to your configuration.
  16. Configure AWS Cognito Pool

  17. Click on Create Pool button to save your settings and create a user pool.
  18. Save AWS Cognito Pool

  19. In the navigation bar present on the left side, click on the App Client Settings option under the App Integration menu.
  20. AWS Cognito App Details

  21. Enter your Callback/Redirect URL which you will get from your miniOrange plugin present on your Client side under the CallBack URLs text-field. Select Authorization code grant checkbox under the Allowed OAuth Flows and also select openid and profile checkboxes under the Allowed OAuth Scopes option (Please refer to the image below). Click on the Save Changes button to save your configurations.
  22. Configure AWS Cognito App Client

  23. Click on Choose Domain Name option to set a domain name for your app.
  24. AWS Cognito Domain Names

  25. Enter your Domain Name under the Domain Prefix text-field and click on the Save Changes button to save your domain name.
  26. Configure AWS Cognito Domain Name

  27. Click on App Clients option under the General Settings menu in the left side navigation bar. Then, click on the Show Details button to see your App details like Client ID, Client secret etc.
  28. AWS Cognito App Client Details

  29. Copy the Client App ID and Client App Secret text field values and save them under your miniOrange plugin present on the client side under the Client Id and the Client Secret text fields respectively.
  30. AWS Cognito App Client Configuration
    You have successfully completed your AWS Cognito App OAuth Server side configurations.

  31. You can download OAuth Client plugin using the following link.
  32. OAuth Single Sign On – SSO (OAuth client)

     
    AWS Cognito Endpoints and Scope:

    Client ID : from the step 9 above
    Client Secret : from the step 9 above
    Scope: openid
    Authorize Endpoint: https://<cognito-app-domain>/oauth2/authorize
    Access Token Endpoint: https://<cognito-app-domain>/oauth2/token
    Get User Info Endpoint: https://<cognito-app-domain>/oauth2/userInfo

    If you are facing any difficulty please mail us on info@miniorange.com.