jwthandler

package
v0.0.0-...-22bf50c Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwtClaimScope  = "scope"
	JwtClaimSub    = "sub"
	JwtClaimRealm  = "realm"
	JwtClaimAzp    = "azp"
	JwtClaimExp    = "exp"
	JwtClaimIssuer = "iss"
)

Variables

View Source
var (
	ErrInvalidJWT   = errors.New("Invalid JWT token.")
	ErrRevokedToken = errors.New("Token is revoked.")
)
View Source
var (
	// ErrMissingKeyID should be used when the kid attribute is missing in the JWT header
	ErrMissingKeyID = errors.New("Missing key Id in the JWT header")
	// ErrInvalidKeyID should be used when the content of the kid attribute is invalid
	ErrInvalidKeyID = errors.New("Invalid key Id in the JWT header")
)
View Source
var (
	// ErrInvalidClaimScope should be used whenever the scope claim is invalid or missing in the JWT
	ErrInvalidClaimScope = errors.New("Invalid claim: scope")
	// ErrInvalidClaimRealm should be used whenever the scope realm is invalid or missing in the JWT
	ErrInvalidClaimRealm = errors.New("Invalid claim: realm")
	// ErrInvalidClaimSub should be used whenever the claim sub is invalid or missing in the JWT
	ErrInvalidClaimSub = errors.New("Invalid claim: sub")
	// ErrInvalidClaimAzp should be used whenever the claim azp is invalid or missing in the JWT
	ErrInvalidClaimAzp = errors.New("Invalid claim: azp")
	// ErrInvalidClaimExp should be used whenever the claim exp is invalid or missing in the JWT
	ErrInvalidClaimExp = errors.New("Invalid claim: exp")
)

Functions

func ClaimAsInt64

func ClaimAsInt64(t *jwt.Token, claim string) (int64, bool)

func ClaimAsString

func ClaimAsString(t *jwt.Token, claim string) (string, bool)

func ClaimAsStrings

func ClaimAsStrings(t *jwt.Token, claim string) ([]string, bool)

func Marshal

func Marshal(ti *processor.TokenInfo, w io.Writer) error

func New

New returns an http.Handler that is able to validate JWT tokens

func NewTokenInfo

func NewTokenInfo(t *jwt.Token, timeBase time.Time) (*processor.TokenInfo, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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