cognito-identity
TypeScript icon, indicating that this package has built-in type declarations

1.152.1 • Public • Published

Human Authentication using Amazon Cognito

This module provides authentication and authorization using Amazon Cognito for Human Stakeholders. It allows you to create user-based identities in minutes, as well as define RBAC policies for specific Users and Groups.

This module contains all the resources necessary to configure a Human Authentication System, including a default configuration that allows it to be immediately ready for use, including:

  • [x] Cognito User Pools simplify the process of adding Sign-Up and Sign-In functionality to Web-apps, Mobile-apps, and Facebook/Google IDentity Providers (IDP).

  • [x] Cognito Identity Pool provides AWS credentials via IAM roles to End-User Applications, enabling federated access to AWS resources for users within the User Pool. Since we will be integrating Cognito with other AWS services, such as API-Gateway/Lambda & ElasticSearch.

  • [x] Identity Pool default roles: By default, the Identity Pool is configured with two IAM roles for both authenticated and unauthenticated users.

Step 1. Installing NPM package

Install the dependency: npm i cognito-identity or clone this repository.

npm i cognito-identity

In your AWS account, a new CDK/CloudFormation stack will appear containing the module's resources.

Step 2. Integrating it into your App

You can use this module to provide authentication for your apps by adding the following sample CDK code:

import { CognitoIdentity } from 'cognito-identity'

export class CognitoIdentityStack extends Stack {
  
  constructor(scope: Construct, id: string, props?: StackProps) {
    super(scope, id, props);

    /** Cognito Identity AuthA/Z */
    const auth = new CognitoIdentity(this, 'Cognito', {
      projectName: "Job4U",
    })
    
  }
}

Once you have integrated the authentication module into your project, you can edit any of its entities, such as User Pools and Identity Pools - and associate them with any other resource allowed by the CDK or CloudFormation.

Readme

Keywords

Package Sidebar

Install

npm i cognito-identity

Weekly Downloads

2

Version

1.152.1

License

Apache-2.0

Unpacked Size

367 kB

Total Files

16

Last publish

Collaborators

  • nnthanh101