token

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpenID   = "openid"
	Profile  = "profile"
	Email    = "email"
	Groups   = "groups"
	Internal = "internal"
)
View Source
const SignAlgo = "RS256"

SignAlgo const.

Variables

Functions

This section is empty.

Types

type SignClaims

type SignClaims struct {
	Aud    string
	Exp    int64
	Iat    int64
	Issuer string
	Nonce  string
	Scopes []string
}

SignClaims contains claims that are passed to SignExpires func.

type Token

type Token struct {
	User *common.User
}

Token struct.

func New

func New(user *common.User) *Token

New constructs new token which is passed for application.

func (*Token) SignExpires

func (t *Token) SignExpires(key common.JWTKey, claim SignClaims) (string, error)

SignExpires makes new jwt token using expiration time and secret.

type UserJWTClaims

type UserJWTClaims struct {
	*common.User
	jwt.RegisteredClaims
	Nonce string `json:"nonce,omitempty"`
}

UserJWTClaims contains struct for making and parsing jwt tokens.

func Parse

func Parse(raw string, keys []common.JWTKey, options ...jwt.ParserOption) (*UserJWTClaims, error)

Parse will validate jwt token and return token.

Jump to

Keyboard shortcuts

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