Skip to content

Implement #183: Add ES256 support for Apple Push Notifications#239

Merged
bshaffer merged 1 commit intogoogleapis:masterfrom
beamerblvd:add-es256-support
Nov 5, 2019
Merged

Implement #183: Add ES256 support for Apple Push Notifications#239
bshaffer merged 1 commit intogoogleapis:masterfrom
beamerblvd:add-es256-support

Conversation

@beamerblvd
Copy link
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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.

@googlebot googlebot added the cla: no This human has *not* signed the Contributor License Agreement. label Mar 9, 2019
@beamerblvd
Copy link
Copy Markdown
Author

I signed it!

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Mar 9, 2019
@aaronpk
Copy link
Copy Markdown

aaronpk commented Jun 3, 2019

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

@bluefirex
Copy link
Copy Markdown

Also waiting for this to get merged. Desperately needed!

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

Can this be merged and published soon?

@carere
Copy link
Copy Markdown

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
Copy Markdown

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 googleapis: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

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ES256 to the list of supported agorithms

7 participants