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

PAYARA-3824 Use KeyID from JWT header to find public key in JSON Web Key Set #3799

Merged
merged 5 commits into from
Jul 5, 2019

Conversation

lreimer
Copy link
Contributor

@lreimer lreimer commented Feb 26, 2019

This patch will use the KeyID kid header field (if present) from the JSON web token to find the matching public key in a JSON Web Key Set (JWKS) array. If there is no KeyID, then the first key entry will be used just like before.

Following changes:

  • I had to split parsing and verification of the JWT in JwtTokenParser.java so that I can access the JWT header without having to parse the SignedJWT twice.
  • I had to pass the obtained keyID down to the createPublicKeyFromJWKS method in order to be able to find the matching JWK.

@arjantijms arjantijms added this to the 5.192 milestone Feb 27, 2019
@arjantijms
Copy link
Contributor

Jenkins test please

@jGauravGupta
Copy link
Contributor

LGTM, Need to test with MP TCK Runner.

@smillidge smillidge added the PR: CLA CLA submitted on PR by the contributor label Mar 5, 2019
@jGauravGupta
Copy link
Contributor

Jenkins test MicroProfile

1 similar comment
@arjantijms
Copy link
Contributor

Jenkins test MicroProfile

@arjantijms arjantijms assigned MeroRai and unassigned jGauravGupta Mar 6, 2019
@arjantijms
Copy link
Contributor

@MeroRai
Can you test with the MP TCK Runner?

@MeroRai
Copy link
Member

MeroRai commented Mar 14, 2019

Pass the MircoProfile TCK on the Payara Server. Although the TCK Runner will need to be updated for this PR to pass the test. I believe @jGauravGupta already did it but it has been revert back.

@smillidge
Copy link
Contributor

Fixes #3795

@MeroRai MeroRai requested a review from arjantijms March 25, 2019 11:07
@Pandrex247 Pandrex247 added Action Required and removed PR: DO NOT MERGE Don't merge PR until further notice labels May 3, 2019
@Pandrex247
Copy link
Member

Pandrex247 commented May 3, 2019

Need to make sure both repos are updated at the same time.
PR into MP TCK Runners: payara/MicroProfile-TCK-Runners#39

@Pandrex247 Pandrex247 removed this from the 5.192 milestone May 20, 2019
@Pandrex247 Pandrex247 changed the title Use KeyID from JWT header to find public key in JSON Web Key Set PAYARA-3824 Use KeyID from JWT header to find public key in JSON Web Key Set May 20, 2019
@arjantijms
Copy link
Contributor

Jenkins test please

@smillidge
Copy link
Contributor

jenkins test please

Copy link

@AlanRoth AlanRoth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and passed MPTCKs with TEST-198's changes (#4054 and payara/MicroProfile-TCK-Runners#44)

@AlanRoth
Copy link

AlanRoth commented Jul 4, 2019

jenkins test please

1 similar comment
@AlanRoth
Copy link

AlanRoth commented Jul 4, 2019

jenkins test please

I apologise, it was due to trying to resolve the conflicts using GitHub, which didn't save properly.
@AlanRoth
Copy link

AlanRoth commented Jul 4, 2019

jenkins test please

@AlanRoth AlanRoth merged commit 601701f into payara:master Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: CLA CLA submitted on PR by the contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants