All Projects → nordcloud → cognito-go-auth

nordcloud / cognito-go-auth

Licence: Apache-2.0 license
Simple library to sign requests using cognito Google federated authentication.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to cognito-go-auth

Aws Mobile React Sample
A React Starter App that displays how web developers can integrate their front end with AWS on the backend. The App interacts with AWS Cognito, API Gateway, Lambda and DynamoDB on the backend.
Stars: ✭ 650 (+3962.5%)
Mutual labels:  cognito
Cognitocurl
🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.
Stars: ✭ 76 (+375%)
Mutual labels:  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 (+931.25%)
Mutual labels:  cognito
Aws Serverless Auth Reference App
Serverless reference app and backend API, showcasing authentication and authorization patterns using Amazon Cognito, Amazon API Gateway, AWS Lambda, and AWS IAM.
Stars: ✭ 724 (+4425%)
Mutual labels:  cognito
Aws Amplify Ecommerce
Learn how to integrate AWS Amplify and Amazon Pinpoint to create a retail website. You use the event data that's generated by customers activities on your site to send custom-tailored emails, creating a curated, omnichannel experience.
Stars: ✭ 71 (+343.75%)
Mutual labels:  cognito
Aws Cli Cheatsheet
☁️ AWS CLI + JQ = Make life easier
Stars: ✭ 94 (+487.5%)
Mutual labels:  cognito
Warrant
Python library for using AWS Cognito. With support for SRP.
Stars: ✭ 384 (+2300%)
Mutual labels:  cognito
Terraform Aws Cognito Auth
Serverless Authentication as a Service (AaaS) provider built on top of AWS Cognito
Stars: ✭ 248 (+1450%)
Mutual labels:  cognito
Ixortalk.aws.cognito.jwt.security.filter
Spring Boot security filter for decoding Cognito JWT IdTokens
Stars: ✭ 75 (+368.75%)
Mutual labels:  cognito
Cognito Backup Restore
AIO Tool for backing up and restoring AWS Cognito User Pools
Stars: ✭ 142 (+787.5%)
Mutual labels:  cognito
Cfn Generic Custom Resource
CloudFormation generic custom resource provider
Stars: ✭ 26 (+62.5%)
Mutual labels:  cognito
Amplify Js
A declarative JavaScript library for application development using cloud services.
Stars: ✭ 8,539 (+53268.75%)
Mutual labels:  cognito
Aws Aspnet Cognito Identity Provider
ASP.NET Core Identity Provider for Amazon Cognito
Stars: ✭ 111 (+593.75%)
Mutual labels:  cognito
Aws Cognito Angular Quickstart
An Angular(v5)-based QuickStart single-page app utilizing Amazon Cognito, S3, and DynamoDB (Serverless architecture)
Stars: ✭ 685 (+4181.25%)
Mutual labels:  cognito
Aws Mobile React Native Starter
AWS Mobile React Native Starter App https://aws.amazon.com/mobile
Stars: ✭ 2,247 (+13943.75%)
Mutual labels:  cognito
Aws Amplify Graphql
Sample using AWS Amplify and AWS AppSync together for user login and authorization when making GraphQL queries and mutations. Also includes complex objects for uploading and downloading data to and from S3 with a React app.
Stars: ✭ 490 (+2962.5%)
Mutual labels:  cognito
React Cognito Auth
A sample authentication app implemented with a server-less architecture, using cognito User Pools, API Gateway, react
Stars: ✭ 76 (+375%)
Mutual labels:  cognito
openapi-tf-example
Example of how you can use OpenAPI with AWS API Gateway, Also includes integrations with AWSLambda, AWS Cognito, AWS SNS and CloudWatch logs
Stars: ✭ 38 (+137.5%)
Mutual labels:  cognito
Retail Demo Store
AWS Retail Demo Store is a sample retail web application and workshop platform demonstrating how AWS infrastructure and services can be used to build compelling customer experiences for eCommerce, retail, and digital marketing use-cases
Stars: ✭ 238 (+1387.5%)
Mutual labels:  cognito
Django Cognito Jwt
An Authentication backend for Django Rest Framework for AWS Cognito JWT tokens
Stars: ✭ 127 (+693.75%)
Mutual labels:  cognito

cognito-go-auth Build Status Go Report Card

Cognito-go-auth is the golang library that allows you to easily generate Cognito Authentication Token and sign requests. Currently it supports only Google federated authentication using Cognito hosted UI.

How it works?

  • It creates HTTP server on the localhost:3000 and serves HTML page with the Cognito hosted UI.
  • It creates websocket on localhost:3001 used to communicate with the web browser.
  • It automatically opens web browser.
  • When user authenticate using Google account, JS script sends the Authenticated Token to the websocket.

Installation

go get github.com/nordcloud/cognito-go-auth

Use source code to sign request in your application

The main use case for this library is to use the CognitoAuthorizer from the auth package to sign requests in your command line application.

To create cognito authorizer you can either use NewCongitoAuthorizer function:

authorizer := NewCongitoAuthorizer(
    cognitoUserPoolId, cognitoClientId, cognitoHostedUI
)

or create it using settings from the environment variables:

authorizer, err := auth.GetAuthorizerFromEnv(userPoolID, clientID, hostedUIDomain)

To generate cognito Authorization token you have to execute:

token, err := authorizer.GetToken()

Signing requests is possible using the token.Sign(request) method. Please not that you can also manually sign request by adding Authorization header.

You can check main.go file for the example implementation of the CURL tool.

Use as a standalone cognito signed CURL

Usage: cognito-go-auth [flags] request_url

Flags:

  • -c, --client-id AWS cognito Client ID
  • -H, --header Request header 'HeaderName: HeaderValue'
  • -u, --hosted-ui Addres of the hosted UI
  • -X, --request Request method (default "GET")
  • -p, --user-pool-id AWS cognito user pool ID
  • -v, --verbose Show response status and headers

You can also use environment variables to store cognito configuration:

  • USER_POOL_ID AWS cognito user pool ID
  • CLIENT_ID AWS cognito Client ID
  • HOSTED_UI Addres of the hosted UI

Example:

cognito-go-auth -H "Header1: Header1Value" -X POST https://api.application.nordcloudapp.com
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].