auth0

package module
v0.0.0-...-07e1bd4 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2018 License: MIT Imports: 12 Imported by: 3

README

Auth0 authentication for net/http and fasthttp

Go Report GolangCI Travis codecov License Maintenance GoDoc

Features:

go get github.com/apibillme/auth0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cached cache.Cache

Cached - the cache for the tokens

Functions

func GetEmail

func GetEmail(token *jwt.Token, audience string) (string, error)

GetEmail - get email as a custom claim from the access_token

func GetScopes

func GetScopes(token *jwt.Token) ([]string, error)

GetScopes - get the scopes of the token

func New

func New(keyCapacity int, ttl int64)

New - set cache options - total keys at one-time and ttl in seconds

func Validate

func Validate(jwkURL string, audience string, issuer string, req *http.Request) (*jwt.Token, error)

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

func ValidateFast

func ValidateFast(jwkURL string, audience string, issuer string, req *fasthttp.RequestCtx) (*jwt.Token, error)

ValidateFast - validate with JWK & JWT Auth0 & audience & issuer for fasthttp

Types

type URLScope

type URLScope struct {
	Method string
	URL    string
}

URLScope - url scope type

func GetURLScopes

func GetURLScopes(token *jwt.Token) ([]URLScope, error)

GetURLScopes - get the URL scopes from the scopes from the token

Jump to

Keyboard shortcuts

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