auth0 / node-jsonwebtoken

JsonWebToken implementation for node.js http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html
MIT License
17.73k stars 1.23k forks source link

Set options via Environment Variables #951

Open brandon93s opened 11 months ago

brandon93s commented 11 months ago

Describe the problem you'd like to have solved

Ability to set config options (e.g., clockTolerance), via environment variables to work-around libraries which leverage jsonwebtoken internally but are not exposing config options to the end-user.

Describe the ideal solution

opts.clockTolerance ?? process.env.clockTolerance etc.

Alternatives and current work-arounds

No current workaround, outside of a custom patch. An alternative would be a major upstream refactor in firebase (and others) to properly allow for option consumption. This would be preferable, in an ideal world.

Additional context

Trying to account for minor clock skew between client mobile & IoT devices through clockTolerance.