Dimitri Kopriwa
Dimitri Kopriwa

Reputation: 14385

What is options notBefore in auth0 node-jsonwebtoken for?

I am reading https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback documentation.

It says:

  • notBefore: expressed in seconds or a string describing a time span zeit/ms.

    Eg: 60, "2 days", "10h", "7d". A numeric value is interpreted as a seconds count. If you use a string be sure you provide the time units (days, hours, etc), otherwise milliseconds unit is used by default ("120" is equal to "120ms").

What is this options for?

Upvotes: 0

Views: 1231

Answers (1)

Phat Tran
Phat Tran

Reputation: 3890

You can check this document

https://www.rfc-editor.org/rfc/rfc7519

The section 4.1.5. "nbf" (Not Before) Claim

The "nbf" (not before) claim identifies the time before which the JWT
   MUST NOT be accepted for processing.  The processing of the "nbf"
   claim requires that the current date/time MUST be after or equal to
   the not-before date/time listed in the "nbf" claim.  Implementers MAY
   provide for some small leeway, usually no more than a few minutes, to
   account for clock skew.  Its value MUST be a number containing a
   NumericDate value.  Use of this claim is OPTIONAL.

Upvotes: 1

Related Questions