Skip to content

No ParserOption for requiring nbf claim #455

@equalsgibson

Description

@equalsgibson

Description

Reviewing the current ParserOptions, there are many methods to check optional registered claim values (such as WithExpirationRequired()).

It would appear that the Not Before value is checked currently, but there is no supported way to "require" the not before value like there is with other registered claims.

Current behaviour

Currently, if the nbf claim is not present the default parser will not raise a token validation error.

NOTE: The default parser currently DOES return an error if the nbf claim is present and it is invalid (i.e. wrong format, invalid time).

Expected behaviour

I want to require the nbf claim and return the error jwt.ErrTokenRequiredClaimMissing if it is not present.

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