Git Product home page Git Product logo

cognito-token-requestor's Introduction

AWS Cognito Token Requestor

This utility application will get an AWS Cognito web token from the User Pool. Once one has the token, use it in Postman to test your APIs.

Getting started

  • Download nodejs.
  • Clone the source code

Get dependencies:

npm install

Execute:

node index.js

Examples:

Node arguments example

node index.js [UserPoolId] [UserPoolClientId] [Username] [Password]

node index.js ap-southeast-2_XXXXXXX 2bb2344vcfldtha3qh0mj75 [email protected] passwordpassword

.env example

  • Rename .env.example to .env
  • Replace content with the values of your cognito user pool.

Sample content:

UserPoolId=ap-southeast-2_XXXXXXX
UserPoolClientId=2bb2344vcfldtha3qh0mj75
Username=test@test.com
Password=passwordpassword

Run:

npm run get-token-env

Output:

Authentication Successful
dfkjhrte87634875345lBsaWNLZ0FrRU84blh4YldGdlhCZ3J2YXZORT0iLCJhbGciOiJSUzI1NiJ9.eyJzdWI34555566hhhjkYTQ4LTRmZDgtYTcwOC1hZDMwMmFlYWYwZjkiLCJhdWQiOiI1YmIyMThmdmNmbG1vYWEzcWhydHIwbWo3OSIsImV2ZW50X2lkIjoiYjA4ODMzOTktMDIzMS00MmJmLTkyYzgtNDE0ZDE3MjQxMWY5IiwidG9rZW5fdXNlIjoiaWQiLCJEDRFTGYHzA4MTksImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC5hcC1zb3V0aGVhc3QtMi5hbWF6b25hd3MuY29tXC9hcC1zb3V0aGVhc3QtMl9JWU5TY1E1MjIiLCJjb2duaXRvOnVzZXJuYW1lIjoiYTgzZWYzOTUtNWE0OC00ZmQ4LWE3MDgtYWQzMDJhZWFmMGY5IiwiZXhwIjoxN4456fgttyCJpYXQiOjE1NzQ4MzA4MTksImVtYWlsIjoidGVzdEB0ZXN0LmNvbSJ9.JDMNYiK1ERvB9qHUC8iZ_O6gR0CsgriaxB77PQzaDyoYorKPHc6tWUwv8H9UgFZFYq-vacrEgmZBivqWje6fJerbcaa1rEjoIqhGfK1bbq0Hgg-eZOg0BqWpCeikjCJ2ozXwDmuCMfcimmA66yWpQEHs6-xeuE2RQ5pwawzBGAOOKUJtg56tgfred4GMfLEhORGpdhnfyvHF-Mg67sWerffgtyhh

The ugly string dfkjhrte87634875345... is the token. Copy that long string value and paste it in Postman.

Files created after running test.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.