Skip to content
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

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

beamerblvd
Copy link

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.

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.
@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

1 similar comment
@googlebot
Copy link

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. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@beamerblvd
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Mar 9, 2019
@aaronpk
Copy link

aaronpk commented Jun 3, 2019

Looks great, what's the holdup on merging this?

@bluefirex
Copy link

Also waiting for this to get merged. Desperately needed!

@Zandor300 Zandor300 mentioned this pull request Aug 9, 2019
@jerome2710
Copy link

Can this be merged and published soon?

@carere
Copy link

carere commented Sep 10, 2019

Plz Merge this, i need it for Sign in With Apple. What can it be merged ??? Can you communicate about this ???

@jerome2710
Copy link

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'],
    ];
}

@bshaffer bshaffer merged commit 2e5281c into firebase:master Nov 5, 2019
Zandor300 added a commit to Zandor300/jsonwebtoken.github.io that referenced this pull request Dec 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ES256 to the list of supported agorithms
7 participants