Для чего нужны опции notBefore в auth0 node-jsonwebtoken? - PullRequest
0 голосов
/ 29 сентября 2019

Я читаю https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback документацию.

Там написано:

  • notBefore: выражено в секундах или строка, описывающая промежуток времени zeit/ мс .

    Например: 60, "2 days", "10h", "7d".Числовое значение интерпретируется как количество секунд.Если вы используете строку, убедитесь, что вы указали единицы времени (дни, часы и т. Д.), В противном случае по умолчанию используется единица измерения в миллисекундах ("120" равно "120ms").

Для чего нужны эти опции?

1 Ответ

1 голос
/ 29 сентября 2019

Вы можете проверить этот документ

https://tools.ietf.org/html/rfc7519

Раздел 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.
...