Documentation ¶
Index ¶
- func CreateToken(ctx context.Context, privateKey *rsa.PrivateKey, keyID string, ...) (string, error)
- func ExtractBearerToken(h *http.Header) (string, error)
- func IsExpired(jwt string) (bool, error)
- func ParseClaimsUnverified(token string) (*oidc.TokenClaims, error)
- func ParseClaimsVerified(token string, key *rsa.PublicKey) (*oidc.TokenClaims, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
func CreateToken(ctx context.Context, privateKey *rsa.PrivateKey, keyID string, tokenID uuid.UUID, claims oidc.TokenClaims, jwtIssuerURL string, validFor int64) (string, error)
CreateToken creates a new JWT
func ExtractBearerToken ¶
ExtractBearerToken extracts a bearer token from an HTTP request or returns an error if none is found or if it's malformed. NOTE: this doesn't enforce that it's a JWT, much less a valid one.
func IsExpired ¶
IsExpired returns `true, nil` if the supplied JWT has valid claims and is expired, `false, nil` if it has valid claims and is unexpired, and `true, err` if the claims aren't parseable. NOTE: It does NOT validate the token's signature!
func ParseClaimsUnverified ¶
func ParseClaimsUnverified(token string) (*oidc.TokenClaims, error)
ParseClaimsUnverified extracts the claims from a token without validating its signature or anything else.
func ParseClaimsVerified ¶
ParseClaimsVerified extracts the claims from a token and verifies the signature, expiration, etc.
Types ¶
This section is empty.