Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nbf should be allowed to be equal to iat #8

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

francislavoie
Copy link
Contributor

I have a PASETO with a payload like this:

..."iat":"2024-03-07T13:15:41-05:00","nbf":"2024-03-07T13:15:41-05:00"...

The iat and nbf claims are the same, but I get an error when validating:

Payload must have a valid "nbf" claim (is not greater than "iat")

I think this is incorrect, the condition should allow equal values.

Arguably an equal nbf doesn't serve much value, but the error is surprising regardless.

I didn't add a test cause I just did this change via GitHub UI without checking out the repo. I figure a simple test should be added to cover this case.

@miunau
Copy link
Collaborator

miunau commented Mar 7, 2024

Yeah, the spec for parsing didn't specify this case specifically, and I was being a bit overzealous. I see your point so I'm gonna merge this, thanks!

@miunau miunau merged commit 1699604 into auth70:main Mar 7, 2024
2 checks passed
@francislavoie francislavoie deleted the patch-1 branch March 7, 2024 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants