Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add NBF clock tolerance #63

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidbonting
Copy link

Sometimes the server clock time differs between machines. That's why we needed some tolerance within the NBF. So I looked at node-jsonwebtoken and implemented the same kind of functionality.

This fork fits our needs, but if we want to release this we probably want to change this part:

    if(args.length===4){
      verifier.setNbfTolerance(args[3]);

      if(args[2]==null){
        verifier.setSigningAlgorithm('none');
      }else{
        verifier.setSigningAlgorithm(args[2]);
      }

      if(args[1]==null){
        verifier.setSigningKey('');
      }else{
        verifier.setSigningKey(args[1]);
      }
    }

and

nJwt.verify(token,null,null,1000,function(err){

It's kind of ugly. Yet I don't know how to solve it without completely changing that function (without creating a breaking change).

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 99.288% when pulling 5c4fb61 on davidbonting:feature/nbf-clocktolerance into c334bf3 on jwtk:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.7%) to 99.288% when pulling 5c4fb61 on davidbonting:feature/nbf-clocktolerance into c334bf3 on jwtk:master.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants