Documentation ¶
Index ¶
- type PKIJWTVerifier
- func NewVerifier(v *PKIJWTVerifier) (*PKIJWTVerifier, error)
- func NewVerifierFromFile(jwtcertPath string, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error)
- func NewVerifierFromPEM(jwtCertPEM []byte, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PKIJWTVerifier ¶
type PKIJWTVerifier struct { JWTCertPEM []byte RedirectOnFail bool RedirectOnNoToken bool RedirectURL string // contains filtered or unexported fields }
PKIJWTVerifier is a generic JWT PKI verifier. It assumes that the tokens have been signed by a private key, and it validates them with the provide public key. This is a simple and stateless verifier that doesn't depend on central server for validating the tokens. The public key is provided out-of-band.
func NewVerifier ¶
func NewVerifier(v *PKIJWTVerifier) (*PKIJWTVerifier, error)
NewVerifier creates a new verifier from the provided configuration.
func NewVerifierFromFile ¶
func NewVerifierFromFile(jwtcertPath string, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error)
NewVerifierFromFile assumes that the input is provided as file path.
func NewVerifierFromPEM ¶
func NewVerifierFromPEM(jwtCertPEM []byte, redirectURI string, redirectOnFail, redirectOnNoToken bool) (*PKIJWTVerifier, error)
NewVerifierFromPEM assumes that the input is a PEM byte array.
func (*PKIJWTVerifier) Callback ¶
Callback is called by an IDP. Not implemented here. No central authorizer for the tokens.
func (*PKIJWTVerifier) IssueRedirect ¶
func (j *PKIJWTVerifier) IssueRedirect(originURL string) string
IssueRedirect issues a redirect. Not implemented. There is no need for a redirect.
func (*PKIJWTVerifier) Validate ¶
Validate parses a generic JWT token and flattens the claims in a normalized form. It assumes that the JWT signing certificate will validate the token.
func (*PKIJWTVerifier) VerifierType ¶
func (j *PKIJWTVerifier) VerifierType() common.JWTType
VerifierType returns the type of the verifier.