Skip to content

JWT Authentication with AWS Cognito in Go + Gin Middleware

License

Notifications You must be signed in to change notification settings

hiepd/cognito-go

Repository files navigation

cognito-go build Go Report Card Coverage Status

JWT Authentication with AWS Cognito in Go + Gin Middleware

Usage

Single

import "github.com/hiepd/cognito-go"

c, _ := cognito.NewCognito("ap-southeast-2", "cognito-app", "xxx")
token, err := c.VerifyToken("abc")

Gin Middleware

import (
  "github.com/hiepd/cognito-go"
  "github.com/gin-gonic/gin"
)

c, _ := cognito.NewCognito("ap-southeast-2", "cognito-app", "xxx")
r := gin.New()
r.GET("/protected", c.Authorize(), protectedEndpoint)

About

JWT Authentication with AWS Cognito in Go + Gin Middleware

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages