jwt

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 4 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 {
	Token oauth2.Token `json:"oauth_token"`

	jwt.RegisteredClaims
}

type JWT

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

func New

func New(secret []byte) JWT

func (JWT) NewAccessToken

func (j JWT) NewAccessToken(oauthToken oauth2.Token, expiresAt time.Time) (string, error)

func (JWT) NewRefreshToken

func (j JWT) NewRefreshToken(oauthRefreshToken string, expiresAt time.Time) (string, error)

func (JWT) ValidateAccessToken

func (j JWT) ValidateAccessToken(accessToken string) (*Claims, bool)

func (JWT) ValidateRefreshToken

func (j JWT) ValidateRefreshToken(refreshToken string) (*RefreshClaims, bool)

type RefreshClaims

type RefreshClaims struct {
	RefreshToken string `json:"oauth_refresh_token"`

	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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