Skip to content

[Notifier] [Firebase] Add 'HTTP v1' api endpoint #53336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
Env Special Chars Encode
  • Loading branch information
cesurapp committed Jul 9, 2024
commit a068ca4abc1ee2d69265e0d64fc32b230b710968
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private function getJwtToken(): string

$header = $this->urlSafeEncode(['alg' => 'RS256', 'typ' => 'JWT']);
$payload = $this->urlSafeEncode($payload);
openssl_sign($header . '.' . $payload, $signature, openssl_pkey_get_private($this->credentials['private_key']), OPENSSL_ALGO_SHA256);
openssl_sign($header . '.' . $payload, $signature, openssl_pkey_get_private($this->encodePk($this->credentials['private_key'])), OPENSSL_ALGO_SHA256);
$signature = $this->urlSafeEncode($signature);

return $header . '.' . $payload . '.' . $signature;
Expand All @@ -129,4 +129,9 @@ protected function urlSafeEncode(string|array $data): string

return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}

protected function encodePk(string $privateKey): string
{
return str_replace(['_', ' ', 'BEGIN+PRIVATE+KEY', 'END+PRIVATE+KEY'], ["\n", '+', 'BEGIN PRIVATE KEY', 'END PRIVATE KEY'], $privateKey);
}
}
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy