jwt

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Example
v := NewValidator(exampleJwks())
tok := exampleToken()

var payload struct {
	Name string `json:"name"`
}

err := v.Validate(tok, &payload)

if err != nil {
	fmt.Println(err)
	return
}

fmt.Println(payload.Name)
Output:

John Doe

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(v *Validator)

func WithAudience

func WithAudience(aud string) Option

func WithClock

func WithClock(fn func() time.Time) Option

func WithClockSkew

func WithClockSkew(seconds int) Option

func WithIssuer

func WithIssuer(iss string) Option

func WithJSONUnmarshaler

func WithJSONUnmarshaler(fn func(data []byte, v any) error) Option

func WithoutClaimValidation

func WithoutClaimValidation() Option

type Validator

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

func NewValidator

func NewValidator(jwks jwks.JWKS, opt ...Option) *Validator

func (*Validator) Validate

func (v *Validator) Validate(tok []byte, dst any) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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