oauth2-server-php
oauth2-server-php copied to clipboard
No easy way to customize JWT header
The Jwt
encryption class has the header hardcoded in the encode
function, and requires quite a bit to override.
We should make sign
protected, and make the headers editable (or pass them in when you encode the token in the first place)
Agreed. If we want to support key rollover on the app side for OpenID Connect (something that Google does for its implementation), we need a way to stick the key id in that header.
Yep, exactly. I'm doing this in my own implementation, but I've had to override the JWT class to do s— Brent Shaffer
On Wed, May 21, 2014 at 1:09 PM, Bojan Zivanovic [email protected] wrote:
Agreed. If we want to support key rollover on the app side for OpenID Connect (something that Google does for its implementation), we need a way to stick the key id in that header.
Reply to this email directly or view it on GitHub: https://github.com/bshaffer/oauth2-server-php/issues/363#issuecomment-43800838
We'll either need to add a $kid param to encode() as well, or make the private key an array / object, no?
I think we'd want something more robust, as there are many parameters available, not just "kid"
implemented with https://github.com/bshaffer/oauth2-server-php/pull/795
@svycka @bshaffer when will #795 be released?
it is merged so in next release
On Sat, Aug 26, 2017, 15:30 clubery [email protected] wrote:
@svycka https://github.com/svycka @bshaffer https://github.com/bshaffer when will #795 https://github.com/bshaffer/oauth2-server-php/pull/795 be released?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bshaffer/oauth2-server-php/issues/363#issuecomment-325122653, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNj_oWq4KraYyxYcWUqfdgyppntO-BVks5scA_ggaJpZM4BvC_5 .
@svycka I believe that you may be confusing the JWT header from the JWT payload. #795 made it easier to modify the payload; however the JWT header is generated later during the encodeToken
phase.
@BVMiko yes, you are right this is for payload, not a header
The kid must be placed in the JWT header of the ID token.
I believe we have this fixed downstream in the Drupal Oauth2_Server module:
https://github.com/matrix-org/synapse/issues/13747#issuecomment-1268719703 https://www.drupal.org/project/oauth2_server/issues/2288237#comment-14737774