title: What is secret key for JWT based authentication and how to generate it?
body: <p>Recently I started working with JWT based authentication. After user login, a user token is generated which will look like </p>
  
  <pre><code>"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ".
  </code></pre>
  
  <p>It consist of three parts each separated with a dot(.).First part is header which Base64 encoded. After decoding we will get something like </p>
  
  <pre><code>{
    "alg": "HS256", //Algorithm used
    "typ": "JWT"
  }
  </code></pre>
  
  <p>Second part is claims and Base64 encoded. After decoding we will get something like</p>
  
  <pre><code>{
    "sub": "1234567890",
    "name": "John Doe",
    "admin": true
  }
  </code></pre>
  
  <p>Third part is signature and is generated with</p>
  
  <pre><code>HMACSHA256(
      base64UrlEncode(header) + "." +
      base64UrlEncode(payload),
      *secret base64 encoded*
    )  
  </code></pre>
  
  <p>Now what is this secret key and how to generate this secret key??</p>
  
  <p>I tried some online generator like "<a href="http://kjur.github.io/jsjws/tool_jwt.html" rel="noreferrer">http://kjur.github.io/jsjws/tool_jwt.html</a>"
  but dint get much help.</p>