jwt

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	UserIdentity  string   `json:"UserIdentity"`
	IsFresh       bool     `json:"IsFresh"`
	IsRefresh     bool     `json:"IsRefresh"`
	Scopes        []string `json:"Scopes"`
	CreationUTC   int64    `json:"CreationUTC"`
	ExpirationUTC int64    `json:"ExpirationUTC"`
	jwt.StandardClaims
}

Claims is used to store jwt claims

type JWT

type JWT struct{}

JWT is a low level JSON web token manager

func (JWT) AccessAndRefreshTokens

func (jwt JWT) AccessAndRefreshTokens(
	userIdentity string, scopesRequested []string) (string, string)

AccessAndRefreshTokens is used to generate access and refresh token

func (JWT) FreshToken

func (jwt JWT) FreshToken(userIdentity string) string

FreshToken is used to generate a fresh access token

func (JWT) RefreshTokens

func (jwt JWT) RefreshTokens(refreshTokenString string) (string, string, string, error)

RefreshTokens is used to generate new access and refresh token based on previous refresh token

func (JWT) ValidateToken

func (jwt JWT) ValidateToken(tokenString string) (bool, Claims, string, error)

ValidateToken is used to validate any type of token

Jump to

Keyboard shortcuts

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