jwtutil

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// claims from https://datatracker.ietf.org/doc/html/rfc7519 .
	JWTClaimAudience   = "aud"
	JWTClaimExpiration = "exp"
	JWTClaimIssuedAt   = "iat"
	JWTClaimIssuer     = "iss"
	JWTClaimJWTID      = "jti"
	JWTClaimNotBefore  = "nbf"
	JWTClaimSubject    = "sub"
)

Variables

This section is empty.

Functions

func CreateHS256SignedString added in v0.21.8

func CreateHS256SignedString(key []byte, claims map[string]any) (string, error)

func NewTokenOAuth2JWT

func NewTokenOAuth2JWT(ctx context.Context, tokenURL, clientID, clientSecret, jwtBase64Enc string) (*oauth2.Token, error)

func ParseJWTString

func ParseJWTString(tokenString string, secretKey string, claims jwt.Claims) (*jwt.Token, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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