All Projects → nordcloud → Cognitocurl

nordcloud / Cognitocurl

Licence: mit
🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Cognitocurl

Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-64.47%)
Mutual labels:  aws, amazon-web-services, cognito
Cognito Express
Authenticates API requests on a Node application by verifying the JWT signature of AccessToken or IDToken generated by Amazon Cognito.
Stars: ✭ 165 (+117.11%)
Mutual labels:  aws, amazon-web-services, cognito
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (+23.68%)
Mutual labels:  aws, cli, cognito
Aegea
Amazon Web Services Operator Interface
Stars: ✭ 51 (-32.89%)
Mutual labels:  aws, cli
Docker Swarm
🐳🐳🐳 This repository is part of a blog series on Docker Swarm example using VirtualBox, OVH Openstack, Azure and Amazon Web Services AWS
Stars: ✭ 43 (-43.42%)
Mutual labels:  aws, amazon-web-services
Amplify Js
A declarative JavaScript library for application development using cloud services.
Stars: ✭ 8,539 (+11135.53%)
Mutual labels:  aws, cognito
Content Dynamodb Deepdive
Amazon DynamoDB Deep Dive Course
Stars: ✭ 59 (-22.37%)
Mutual labels:  aws, amazon-web-services
Saw
Fast, multi-purpose tool for AWS CloudWatch Logs
Stars: ✭ 1,071 (+1309.21%)
Mutual labels:  aws, cli
Cfn Create Or Update
Create or update CloudFormation stack also if no updates are to be performed.
Stars: ✭ 59 (-22.37%)
Mutual labels:  aws, amazon-web-services
Wsend
wsend: The opposite of wget
Stars: ✭ 64 (-15.79%)
Mutual labels:  cli, curl
Cloud Portal
Self service web portal for different Cloud platforms like Azure, AWS and VMWare vSphere.
Stars: ✭ 60 (-21.05%)
Mutual labels:  aws, amazon-web-services
Cloud Security Audit
A command line security audit tool for Amazon Web Services
Stars: ✭ 68 (-10.53%)
Mutual labels:  aws, amazon-web-services
Terraform Nextjs Plugin
A plugin to generate terraform configuration for Nextjs 8 and 9
Stars: ✭ 41 (-46.05%)
Mutual labels:  aws, cli
Terraform Aws Cross Account Role
A Terraform module to create an IAM Role for Cross Account delegation.
Stars: ✭ 30 (-60.53%)
Mutual labels:  aws, amazon-web-services
Serverless Es Logs
A Serverless plugin to transport logs to ElasticSearch
Stars: ✭ 51 (-32.89%)
Mutual labels:  aws, amazon-web-services
Coronavirus Tracker Cli
Track conronavirus cases from command line. curl https://corona-stats.online/
Stars: ✭ 954 (+1155.26%)
Mutual labels:  cli, curl
Bashupload
PHP/JavaScript file upload web app to upload files from command line & browser, and download them elsewhere. Frequently used to upload/download files on servers. Hosted version is available at bashupload.com.
Stars: ✭ 56 (-26.32%)
Mutual labels:  cli, curl
Molecule Ansible Docker Aws
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers
Stars: ✭ 72 (-5.26%)
Mutual labels:  aws, amazon-web-services
Ecsctl
Command-line tool for managing AWS Elastic Container Service and Projects to run on it.
Stars: ✭ 15 (-80.26%)
Mutual labels:  aws, cli
Aws Auto Terminate Idle Emr
AWS Auto Terminate Idle AWS EMR Clusters Framework is an AWS based solution using AWS CloudWatch and AWS Lambda using a Python script that is using Boto3 to terminate AWS EMR clusters that have been idle for a specified period of time.
Stars: ✭ 21 (-72.37%)
Mutual labels:  aws, amazon-web-services

cognitocurl 🔏

This is CLI tool that allows you to easily sign curl calls to API Gateway with Cognito authorization token.

npm version

Why?

AWS Cognito is really powerful, especially combined with API Gateway, but if you use Cognito Authorizer or Lambda Authorizer based on Authorization header, you may encounter a problem with signing curl calls - this is why we created cognitocurl - it is tiny CLI tool made with Node.js that takes care of signing in against user pool, persisting and rotating tokens, and adding additional header to your curl call.

Made with ❤️ in Nordcloud

Usage

Installation:

$ npm i -g cognitocurl

Then:

$ cognitocurl --cognitoclient XXX --userpool YYY --run "full curl command here"

or

$ cognitocurl --hostedui hosteduisetupfilename.json --run "full curl command here"

Getting access token with a single command

$ cognitocurl --cognitoclient CLIENT_ID --userpool USER_POOL_ID --token --username USER_NAME --password USER_PASSWORD

Available flags

Tools:

  • --version
  • --help

Features:

  • --cognitoclient cognitoclientid - Cognito Client ID
  • --userpool userpoolid - Cognito User Pool ID
  • --header header - Defaults to 'Authorization'
  • --reset - Reset cached Cognito credentials
  • --run "runcommand" - pass your curl command here
  • --hostedui hostedui.json - if passed, Congito Hosted UI will be launched and configured using setup from provided json file
  • --token - if passed, run command will be ignored and access token will be printed to stdout instead
  • --username - if not passed, you will be prompted to enter a username (added to cli authentication)
  • --password - if not passed, you will be prompted to enter a password (added to cli authentication)

Hosted UI json setup example

If you want to use hosted ui, provide --hostedui. You should provide a setup jsonfile file like this:

{
  "region": "eu-west-1",
  "userPoolId": "your_user_pool_id",
  "userPoolWebClientId": "your_web_client_id",
  "redirectSignIn": "http://localhost:3000",
  "redirectSignOut": "http://localhost:3000",
  "domain": "your_hosted_ui_domain"
}

Note that lochalhost:3000 should be added to your Cognito User Pool App Client setup!

Plans for the future

  • add federated/social logins (by opening browser window)

Authors

  • Jakub Holak, Nordcloud 🇵🇱

Credits

Done using oclif. Inspired by AWS Amplify.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].