This Post Was Supposed to Be About AWS Cognito
Some notes from setting up AWS Cognito for authentication on a new SPA, but turns into notes about AWS Amplify.
Some notes on setting up AWS Cogntio User Pools:
I have been using the AWS SDK for Javascript using Node as much as possible, instead of using the dashboard, in order to help keep steps reproducible.
Note that the aws-sdk library will default to use the [default] credentials configured in ~/.aws/credentials, and may fail silently to override them.
Note that it appears that Identity Pools created from the SDK will not appear on the dashboard until you have added a user. Alternatively, this may just be an artifact of eventual consistency on the API.
If you’re looking for the above, you should try Amplify
If you are interested in using AWS Cognito, I suggest you additionally look at AWS Amplify, which helps get you started with Cognito + several other AWS product in one neat package.
Note, however, that if you use the AWS Amplify CLI,
- The default Cognito User Pool that is created will have a phone number and 2fa on
- You cannot change the above setting.
As such, I suggest not creating a Cognito User Pool through the Amplify CLI; it makes local development far more painful than necessary.
Instead, create the Cognito User Pool through the dashboard or using a script.
If you are using Amplify, I’ve started to create a quickstart development environment, though note that it does not have a local stub of AWS Cognito User Pools.