auth0

package module
v0.0.0-...-37c0873 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2020 License: MIT Imports: 7 Imported by: 0

README

Auth0 Golang Authorizer

An Auth0 client written in Go for writing AWS Lambda Authorizers. It is heavily based on github.com/apibillme/auth0. The main change in this fork is that the validating function accepts a string instead of an http request. Since API Gateway provides the token as a string, it was a bit gnarly to be using the http request as the function's input.

Usage

Simple Overview of how the client works Example of how to write a lambda authorizer with this Auth0 client.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JwkFetch = jwk.Fetch

reference vars here for stubbing

View Source
var JwsVerifyWithJWK = jws.VerifyWithJWK

Functions

This section is empty.

Types

type Auth0

type Auth0 struct {
	// contains filtered or unexported fields
}

func NewAuth0

func NewAuth0(keyCapacity int, ttl int64) Auth0

Create a new Auth0 client. keyCapacity indicates the maximum number of keys the Cache will hold. ttl is the time to live in seconds for keys to live in the Cache.

func (Auth0) Validate

func (a Auth0) Validate(jwkURL string, audience string, issuer string, jwtToken string) (*jwt.Token, error)

Validate - validate with JWK & JWT Auth0 & audience & issuer for net/http

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL