title: PHP generate JWT token from SHA256, missing signature
body: <p>I am trying to authenticate as GitHub apps but keep getting error when generating JWT token from private key. The output token always missing the <strong>signature</strong> part, which make it invalid.</p>
  
  <p>Here is my code, I use <a href="https://github.com/lcobucci/jwt" rel="nofollow noreferrer">lcobucci/jwt</a> library for the generation</p>
  
  <pre class="lang-php prettyprint-override"><code>$token = (new Builder())
              -&gt;expiresAt((new DateTimeImmutable('+10 minutes'))-&gt;getTimestamp())
              -&gt;issuedAt((new DateTimeImmutable())-&gt;getTimestamp())
              -&gt;issuedBy($config['appId'])
              -&gt;getToken(new Sha256(), new Key('file://'.$config['keyPath']));
          // output
          // HEADER       .PAYLOAD            .SIGNATURE
          // eyJ0eX***lIn0.eyJleHAiO***0ODMifQ.
  </code></pre>
  
  <p>I already verify the private key validness using this <a href="https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app" rel="nofollow noreferrer">ruby script</a> which generate the complete JWT token and successfully use it to call the API.</p>
  
  <p>This code is part of Laravel 5.8 codebase and I run it with <code>php artisan serve</code> with php 7.3 on Windows 10 OS. I did check the openssl plugin is already enabled.</p>
  
  <p>Library version from composer is <code>"lcobucci/jwt": "3.3.0"</code></p>