This repository was archived by the owner on Jul 9, 2021. It is now read-only.

Description
When we have custom "Header" keys, the auto-generated code for firebase/php-jwt does not accomodate for it.
It should add something like:
$keyId = null;
$header = array(
"alg" => "RS256",
"typ" => "JWT",
"x5t" => "somecustomstring"
);
...
$jwt = JWT::encode($payload, $privateKey, 'RS256', $keyId, $header);
...
In my case I need to add custom header with key "x5t" that contain certificate thumbprint (Microsoft/Azure token stuff)
Likewise, I don't see it specifying encoding algorithm, so it will drop to whatever is the default (HS256).
php-jwt function declaration:
public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null)