1.4.0 • Published 3 years ago

@sungly/cognito-cli v1.4.0

Weekly downloads
12
License
MIT
Repository
github
Last release
3 years ago

cognito-cli

CLI for Cognito user life cycle management and basic user authentication to retrieve JWTs (access token, id token and refresh token).

cognito-cli is a wrapper around aws-sdk and is intended to make user management easier instead of having to write a script for one time user management during local development.

Requirements

  • AWS credentials

    When interacting with Amazon Cognito, it is a requirement to have aws credentials. There are a few methods available to you for getting these credentials. Read here.

    Once you have obtained aws access id and aws access secret, save them to ~/.aws/credentials:

    [default]
    aws_access_key_id=
    aws_secret_access_key=
  • Enable USER_PASSWORD_AUTH on the app client

    General > App client > show details > Enable username password based authentication (ALLOW_USER_PASSWORD_AUTH)

Install

Install globally in order to call cognito-cli from anywhere:

npm install -g @sungly/cognito-cli

Add the following to ~/.cognito/config:

user_pool_id=
client_id=
client_secret=
region=ca-central-1
requiredAttributeList=["email", "given_name", "family_name"]

The requiredAttributeList is used for user registration. Make sure to include attributes that are required for your user pool.

Usage

cognito-cli <command>

Available Commands:
init                        # initializing the CLI

login                       # retrieve access, id and refresh token via USER_PASSWORD_AUTH against a specified user pool in the config.

srp-login                   # retrieve acesss, id and refresh token via SRP authentication.

create-user                 # create a user profile using the `requiredAttributeList`

confirm-user                # confirm user registration with a confirmation code

resend-confirmation-user    # resend the confirmation code

forgot-password             # trigger the forgot password flow

### admin calls - Note these calls require additional IAM privileges

set-user-password           # set user with a new password

get-user-profile            # get the user profile from cognito

verify-user-email           # verify user email in order to get emails

disable-user                # disable user from logging in

enable-user                 # allow user to login

batch-delete-users          # delete all users from a user pool
Other commands
decode-token                # decode JSON web tokens

cognito-cli version         # get the cli version

cognito-cli help            # get help instruction

License

MIT

1.4.0

3 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago