title: Decoding jwt error: Unable to decode the payload as Base64Url encoded string
body: <p>I have a jwt token 'eyJhbGciOiJIUzI1NiJ9.YUExIQ.srnc87a8Se8arhCopLBpgxEvILA2AZxOB8BIrFDHKL4
  ' 
  that was encode in node and I'm trying to decode it in c# but I'm getting an error thrown that it's upset about the payload. </p>
  
  <pre><code>    public void Consume(BasicDeliverEventArgs msg)
      {
          var message = Encoding.UTF8.GetString(msg.Body);
          var user = JsonConvert.DeserializeObject&lt;User&gt;(message);
  
          var handler = new JwtSecurityTokenHandler();
  
          try
          {    
              var x = handler.ReadToken(user.Password) as JwtSecurityToken;
          }
          catch(Exception ex)
          {
              Console.WriteLine(ex.Message);
          }
  
  
  
          _repo.UpdateUser(user);
      }
  </code></pre>
  
  <p>returns error: Unable to decode the payload 'YUExIQ' as Base64Url encoded string</p>
  
  <p>I'm not sure if theres somewhere I can put the secret that was used to encode in the decoding somewhere or if I somehow need to convert the payload the base64 or if I'm just missing some steps somewhere. Thanks in advance. </p>