jwt

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

jwtvalidate

This is a small helper library which validates JWT tokens in concert with my fork of go-iodc.

GitHub Actions status Go Report Card Documentation

License

This code is released under the Apache 2.0 license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitScopes

func SplitScopes(scope string) []string

Types

type JSONTime

type JSONTime time.Time

func (*JSONTime) Time

func (j *JSONTime) Time() time.Time

func (*JSONTime) UnmarshalJSON

func (j *JSONTime) UnmarshalJSON(b []byte) error

type JwtPayload

type JwtPayload struct {
	Sub      string   `json:"sub"`
	TokenUse string   `json:"token_use"`
	Scope    string   `json:"scope"`
	AuthTime JSONTime `json:"auth_time"`
	Issuer   string   `json:"iss"`
	Expires  JSONTime `json:"exp"`
	IssuedAt JSONTime `json:"iat"`
	Version  int      `json:"version"`
	Jti      string   `json:"jti"`
	ClientID string   `json:"client_id"`
}

func Validate

func Validate(ctx context.Context, providerURL, token string) (*JwtPayload, error)

Validate returns validates the token, then returns just the parsed JSON from the JWT

Jump to

Keyboard shortcuts

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