title: JWT Token Invalid Signature
body: <p>I am using JWT in my application for login authentication process. 
  To generate the token I am using: </p>
  
  <pre><code>Jwts.builder().setSubject(username).signWith(SignatureAlgorithm.HS512, MacProvider.generateKey()).compact();
  </code></pre>
  
  <p>Generated Token:</p>
  
  <blockquote>
    <p>eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJlaG91c2VAZGV2ZXJldXgub3JnIn0.5SX-aU-p_RlfC3CZa-YXnQu_YR7RsG2Xfim3LOmlqxjAZrIyZiz0fYZwViHr113ms8TNvngcJcV07U4hK-RBZQ</p>
  </blockquote>
  
  <p>When I decode this token in jwt.io debugger it tells me an invalid Signature. I am not able to find the reason of this failure as I can see the username in the payload which i am using to authenticate. Could anybody point me the issue? Do I need to change anything in the code? </p>