Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrEmptyJWKS error = errors.New("JWKS is empty")
View Source
var ErrInvalidFingerprint error = errors.New("invalid key fingerprint")
View Source
var ErrInvalidKeyType error = errors.New("invalid key type, must be RSA or EC")
Functions ¶
func GenerateJWT ¶
func GenerateJWT(oauth2jose *OAuth2Jose, claims *TokenClaims) jwt.Builder
func LoadOAuth2JoseFromURL ¶
func LoadOAuth2JoseFromURL(oauth2jose *OAuth2Jose) error
func SetupOAuth2Jose ¶
func SetupOAuth2Jose(oauth2jose *OAuth2Jose) error
Types ¶
type JWKS ¶
type JWKS struct {
Keys []jose.JSONWebKey `json:"keys"`
}
type OAuth2Jose ¶
type OAuth2Jose struct { Options *Options Fingerprint string RSAKey *rsa.PrivateKey ECDSAKey *ecdsa.PrivateKey JWK *jose.JSONWebKey JWKS []byte SigningKey *jose.SigningKey Signer jose.Signer Logger *logrus.Logger }
type TokenClaims ¶
type TokenClaims struct { *jwt.Claims Scope string `json:"scope,omitempty"` Kid string `json:"kid,omitempty"` Tenant string `json:"tenant,omitempty"` }
func DecodeJWT ¶
func DecodeJWT(oauth2jose *OAuth2Jose, tokenStr string) (*TokenClaims, error)
Click to show internal directories.
Click to hide internal directories.