auth0 node-jsonwebtoken 中的 notBefore 选项有什么用?
What is options notBefore in auth0 node-jsonwebtoken for?
我正在阅读 https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback 文档。
它说:
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"
).
这个选项有什么用?
你可以查看这个文档
https://www.rfc-editor.org/rfc/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.
我正在阅读 https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback 文档。
它说:
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"
).
这个选项有什么用?
你可以查看这个文档
https://www.rfc-editor.org/rfc/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.