Closed UUSR closed 1 year ago
This seems like the string you are providing as the public key is not the correct format. The error states that the key param cannot be coerced into a public key, meaning it's improperly formatted. It then goes on to say that there's "no start line".
So, it seems like there's something wrong with the keys you're using.
When I try to get the token I get the following error:
Warning: openssl_sign(): supplied key param cannot be coerced into a private key
Fatal error: Uncaught DomainException: OpenSSL unable to sign data
In file JWT.php (Line 235)
case 'openssl':
$signature = '';
$success = \openssl_sign($msg, $signature, $key, $algorithm); // @phpstan-ignore-line
if (!$success) {
throw new DomainException('OpenSSL unable to sign data');
When I am trying to validate the token I get, the error below:
Warning: openssl_verify(): supplied key param cannot be coerced into a public key
"OpenSSL error: error:0909006C:PEM routines:get_name:no start line"
In file JWT.php (Line 292)
case 'openssl':
$success = \openssl_verify($msg, $signature, $keyMaterial, $algorithm); // @phpstan-ignore-line
if ($success === 1) {
return true;
}
if ($success === 0) {
return false;
}
I'm using Firebase on my Apache Server, any suggestions.