kyhau: My folk of awslabs/aws-cognito-angular-quickstart. See all changes here.
The code is modified from https://github.com/awslabs/aws-cognito-angular2-quickstart.
The app provides interface show how to use Cognito User Pool and Cognito Identity Pool to support user sign-up, sign-in and authentication for your app. The app also shows log to log the user login activiies to a DynamoDB table.
See Cognito Web UI in Angular2.
Use Cognito-UserPool-IdentityPool-DynamoDB.template.yaml
in
kyhau/aws-tools/Cognito
to create
- Cognito Identity Pool with auth/unauth roles and policies
- Cognito User Pool
- DynamoDB for storing login activities
- S3 for hosting static website
# Install the NPM & Bower packages, and typings
npm install
npm install -g @angular/cli@latest
# Run the app in dev mode
npm start
# Build the project and sync the output with the S3 bucket
ng build; cd dist; aws s3 sync . s3://(your-bucket-name)/ --acl public-read
# Test it out
curl –I http://(your-bucket-name).s3-website-(your-region).amazonaws.com/
You will need to change the following configurations in
cognito.service.ts
and
ddb.service.ts
.
- User pool ID,
- Identity pool ID,
- Region, and
- DynamoDB Table ID.
As is, the code has default configuration, pointing to the developer's region.