You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -160,6 +160,8 @@ This library automatically validates the `exp` claim, and `nbf` is validated if
160
160
those require setting the expected values in the `Validation` struct. In the case of `aud`, if there is a value set in the token but
161
161
not in the `Validation`, the token will be rejected.
162
162
163
+
Validation is only made on present fields in the claims. It is possible to define the required claims, hence verifying that a JWT has a value for each of these claims before it is considered for validation. The required claims can be set in the `Validation` struct. The default option requires the `exp` claim to be present.
164
+
163
165
Since validating time fields is always a bit tricky due to clock skew,
164
166
you can add some leeway to the `iat`, `exp`, and `nbf` validation by setting the `leeway` field.
0 commit comments