Include Client ID (kid) parameter in the JWT header#932
Open
BVMiko wants to merge 3 commits intobshaffer:mainfrom
Open
Include Client ID (kid) parameter in the JWT header#932BVMiko wants to merge 3 commits intobshaffer:mainfrom
BVMiko wants to merge 3 commits intobshaffer:mainfrom
Conversation
Author
|
I also want to reference to issue #363; though this PR doesn't offer a way to modify the JWT header with arbitrary data; it does automatically provide the |
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently,
Oauth2\Encryption\FirebaseJwt::encodehas a different signature fromOAuth2\Encryption\Jwt::encode; theFirebaseJwtfunction has an additional$keyIdparameter. This parameter, when included, is passed into thekidparameter of the JWT header.Unfortunately, neither of the two classes which use it (
OAuth2\OpenID\ResponseType\IdTokenandOAuth2\ResponseType\JwtAccessToken) include the parameter by default, so a lot of code is required to get this parameter added into the JWT header.This PR modifies the signature of
OAuth2\Encryption\EncryptionInterface::encodeto include the$keyIdparameter, thus standardizing between the two provided encryption implementations to offer a way to incorporate thekidparameter. It also modifies the two ResponseTypes which use theencodemethod to pass the$client_id.There is also one more related issue included in this PR: modern versions of firebase/php-jwt use namespaces, while the references in
Oauth2\Encryption\FirebaseJwtdo not. I've modified this class to use the proper namespace parameters, and also upgraded the minimum suggestion of firebase/php-jwt package from ~2.2 (released 2015-06-22) to ~3.0 (released 2015-07-22).