jwt

package
v0.0.0-...-e1839d5 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type GoogleTokenInfo

type GoogleTokenInfo struct {
	Iss string `json:"iss"`
	// userId
	Sub string `json:"sub"`
	Azp string `json:"azp"`
	// clientId
	Aud string `json:"aud"`
	Iat int64  `json:"iat"`
	// expired time
	Exp int64 `json:"exp"`

	Email         string `json:"email"`
	EmailVerified bool   `json:"email_verified"`
	AtHash        string `json:"at_hash"`
	Name          string `json:"name"`
	GivenName     string `json:"given_name"`
	FamilyName    string `json:"family_name"`
	Picture       string `json:"picture"`
	Local         string `json:"locale"`
	jwt.StandardClaims
}

TokenInfo struct

func ParseUserFromGoogleIDToken

func ParseUserFromGoogleIDToken(id_token string) (*GoogleTokenInfo, error)

type MyCustomClaims

type MyCustomClaims struct {
	UserId string `json:"userId"`
	Email  string `json:"email"`
	jwt.StandardClaims
}

type MyToken

type MyToken struct {
	Token string `json:"token"`
}

type TokenService

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

func ProvideTokenService

func ProvideTokenService(awsService *aws.AWSService) *TokenService

func (*TokenService) GetToken

func (service *TokenService) GetToken(c *gin.Context) string

func (*TokenService) NewToken

func (service *TokenService) NewToken(id, email string) (*MyToken, error)

func (*TokenService) ParseToken

func (service *TokenService) ParseToken(tokenString string) (*MyCustomClaims, error)

Jump to

Keyboard shortcuts

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