Skip to content

Altering Validation Options to jwt.Validate() #59

Open
@carwyn

Description

@carwyn

The new underlying JWT library supports options for validation via jwt.Validate(t Token, options ...ValidateOption), unfortunately this isn't exposed in jwtauth.

jwtauth.Verifier(ja *JWTAuth) calls down the verification stack until jwtauth.VerifyToken(ja *JWTAuth, tokenString string) where in the body there is a call to jwt.Validate(t Token, options ...ValidateOption), unfortunately I can't see a way to alter these options from the jwtauth API though?

Meanwhile the jwtauth.Authenticator(next http.Handler) example also calls jwt.Validate(...) (i.e. a second call to this function in the request sequence) where obviously it's possible to add the validation options using a custom Authenticator.

Is the expectation that a second call to jwt.Validate(...) with or without options parameters will be needed in any custom Authenticator? It looks like if I could pass the options in I could avoid calling the function again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions