title: How to change header of a jsonwebtoken in node.js
body: <p>I need a token to authenticate to a server, I am using <code>jsonwebtoken</code> , but it will only work if the header of the token is </p>
  
  <pre><code>{
    "alg": "RS256"
  }
  </code></pre>
  
  <p>and not</p>
  
  <pre><code>{
    "alg": "RS256",
    "typ": "JWT"
  }
  </code></pre>
  
  <p>and <code>jsonwebtoken</code> default header is the second one, I tried to set the header in with option as explained here <code>https://github.com/auth0/node-jsonwebtoken</code>, but there is no example so maybe I am doing it wrong, but <code>noTimestamp</code> option is working so...
  There is this line in doc "The header can be customized via the options.header object." , i think that the point I don't get.</p>
  
  <pre><code>jwt.sign(payload,
        pvtKey,
        { algorithm: 'RS256', noTimestamp : true, header: {"alg": "RS256"} }, function(err, token) {
          if (err) {
            return res.status(500).send("Error1: "+ err);
          }
          console.log("Created token: " + token);
        });
  </code></pre>
  
  <p>but it just doesn't change anything so if someone know how to set headers?</p>
  
  <p>thanks in advance</p>