utils

package
v0.0.0-...-135feef Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 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 JWTValidator

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

func (*JWTValidator) KeyFunction

func (self *JWTValidator) KeyFunction(token *jwt.Token) (interface{}, error)

`KeyFunc` in `jwt.Parse`. It validates the signing method (RS256 in this caase). Then, it build token key using JWKs.

func (*JWTValidator) ParseJWT

func (self *JWTValidator) ParseJWT(tokenString string) (jwt.MapClaims, error)

Validate token, its signature, basic claims etc. and return all the claims present in the token.

func (*JWTValidator) Validate

func (self *JWTValidator) Validate(tokenString string) (jwt.MapClaims, error)

Verifies the token. It verifies: - If it is actually a token - Signing method (RS256) - Expiration - Issuer - Client

func (*JWTValidator) VerifyClient

func (self *JWTValidator) VerifyClient(client string) bool

Verify `client_id` in the token.

Jump to

Keyboard shortcuts

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