-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Implement #183: Add ES256 support for Apple Push Notifications #239
Conversation
Apple Push Notifications require the JWT algorithm be ES256. It still uses OpenSSL and SHA256 just like RS256, but the algorithm name in the headers must be "ES256" or else the token is rejected as invalid. This simple change adds support for ES256 and improves documentation regarding supported algorithms.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
Looks great, what's the holdup on merging this? |
Also waiting for this to get merged. Desperately needed! |
Can this be merged and published soon? |
Plz Merge this, i need it for Sign in With Apple. What can it be merged ??? Can you communicate about this ??? |
Since the array is public, you could extend the library in the meantime and overwrite the array: <?php
namespace your\namespace;
class JWT extends \Firebase\JWT\JWT
{
public static $supported_algs = [
'ES256' => ['openssl', 'SHA256'],
'HS256' => ['hash_hmac', 'SHA256'],
'HS512' => ['hash_hmac', 'SHA512'],
'HS384' => ['hash_hmac', 'SHA384'],
'RS256' => ['openssl', 'SHA256'],
'RS384' => ['openssl', 'SHA384'],
'RS512' => ['openssl', 'SHA512'],
];
} |
Support was added in firebase/php-jwt#239.
Apple Push Notifications require the JWT algorithm be ES256. It still uses OpenSSL and SHA256 just like RS256, but the algorithm name in the headers must be "ES256" or else the token is rejected as invalid. This simple change adds support for ES256 and improves documentation regarding supported algorithms, which should close #183. I tested this locally, and this change alone allowed me to sent APNs, while I could not without this change.