Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CLAIMS denotes the key to get the claims from context CLAIMS = "Claims" // TOKENERROR denotes the key to get the token error from context TOKENERROR = "TokenError" )
Variables ¶
View Source
var ErrPrivateKey = errors.New("Private key location empty.")
ErrPrivateKey indicates a missing private key location
View Source
var ErrPublicKey = errors.New("Public key location empty.")
ErrPublicKey indicates a missing public key location
View Source
var ErrTokenExpired = errors.New("Token expired")
ErrTokenExpired indicates an expired token
View Source
var ErrTokenMissing = errors.New("Token missing.")
ErrTokenMissing indicates a missing token
View Source
var ErrUnrecognizedTokenFormat = errors.New("Unrecognized token format")
ErrUnrecognizedTokenFormat indicates an invalid token format
Functions ¶
func MustValidate ¶
func MustValidate(errorHandler goji.Handler) func(goji.Handler) goji.Handler
MustValidate returns a middleware for parsing and validating JSON Web Tokens. When this middleware is used, the token must be present in the request and should be valid valid. If the token is invalid, the defaultErrorHandler or the errorHandler provided will be handling the request.
Types ¶
type Claims ¶
type Claims struct { Iss string `json:"iss,omitempty"` Aud string `json:"aud,omitempty"` IsTrusted string `json:"isTrusted,omitempty"` Sub string `json:"sub,omitempty"` Name string `json:"name,omitempty"` FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` ProfileImage string `json:"profileImage,omitempty"` EmailVerified string `json:"emailVerified,omitempty"` Email string `json:"email,omitempty"` Nonce string `json:"nonce,omitempty"` AtHash string `json:"at_hash,omitempty"` Iat int `json:"iat,omitempty"` Exp int `json:"exp,omitempty"` }
Claims represents the claims for sso token
type ErrInvalidToken ¶
type ErrInvalidToken struct {
// contains filtered or unexported fields
}
ErrInvalidToken indicates an invalid token
func (ErrInvalidToken) Error ¶
func (e ErrInvalidToken) Error() string
Click to show internal directories.
Click to hide internal directories.