title: JWT token generated using jsonwebtoken library gives invalid signature in jwt.io
body: <p>In short : the token generated using below code gives the correct headers and payload(when I paste the generated token in JWT.io).</p>
  
  <p>It only works when I insert the secret and press the secret encoded checkbox in jwt.io. After that I get valid token.</p>
  
  <p>But var token = jwt.sign(payload, privateKEY, signOptions);  this step should do the same thing I guess.</p>
  
  <p>My code.</p>
  
  <pre><code>  var jwt = require('jsonwebtoken');
      var payload = {
         "userId" : 'YYYYYYYYYYYYYYYYYYYYYYY',
         "iat" : new Date().getTime(),
      };
      var signOptions = {
        algorithm:  "HS512"  
      };
      var privateKEY = 'XXXXXXXXXXXXXXXXXXXXXXXX'; 
      var token = jwt.sign(payload, privateKEY, signOptions); 
      console.log("Token :" + token);
  </code></pre>
  
  <p>This gives me an invalid token but when i paste that token in jwt.io I get the correct Headers and Payload.
  And if I insert my secret and press the checkbox I get the correct token.
  What I am I doing wrong. Thanks</p>