jwt

package
v0.0.0-...-4c11209 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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