-
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
Adding optional headers to send in JWT #53
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! Martin On Wed, Jun 17, 2015 at 4:18 PM, googlebot [email protected] wrote:
|
Do you have any example how and when this is used? |
yea - check this imp out: https://github.com/layerhq/support/blob/master/identity-services-samples/php/jwt.php they require the addition of: 'cty' => 'layer-eit;v=1' as a header Martin On Thu, Jun 18, 2015 at 1:35 AM, Mika Tuupola [email protected]
|
{ | ||
$header = array('typ' => 'JWT', 'alg' => $alg); | ||
if ($keyId !== null) { | ||
$header['kid'] = $keyId; | ||
} | ||
if ( isset($head) && is_array($head) ) { | ||
$header = array_merge($header, $head); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $head
also contains one of the required fields (typ
, alg
, or - potentially - kid
), this approach would overwrite it, correct? This strikes me as undesirable, but I'm open to other opinions on the matter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does - thought about that and leaned towards allowing it but to be safe
we can do it the other way around to ensure the other params are not
overwritten, will send updated pr shortly
Martin
On Thu, Jun 18, 2015 at 11:22 AM, Rob DiMarco [email protected]
wrote:
In Authentication/JWT.php
#53 (comment):{ $header = array('typ' => 'JWT', 'alg' => $alg); if ($keyId !== null) { $header['kid'] = $keyId; }
if ( isset($head) && is_array($head) ) {
$header = array_merge($header, $head);
If $head also contains one of the required fields (typ,alg, or potentiallykid`),
this approach would overwrite it, correct? This strikes me as undesirable,
but I'm open to other opinions on the matter.—
Reply to this email directly or view it on GitHub
https://github.com/firebase/php-jwt/pull/53/files#r32761604.
CLAs look good, thanks! |
1 similar comment
CLAs look good, thanks! |
Adding optional headers to send in JWT
Some services require additional info to be sent in the JOSE header, adding the option for encoding.