Skip to content

Commit

Permalink
JWT-Auth implementation encrypted token recognition fixed (#4811)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kral <[email protected]>
  • Loading branch information
Verdent authored Aug 31, 2022
1 parent 5091b0c commit e21d85f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ AuthenticationResponse authenticate(ProviderRequest providerRequest, LoginConfig
SignedJwt signedJwt;
try {
headers = JwtHeaders.parseToken(token);
if (headers.encryption().isPresent()) {
if (headers.encryption().isPresent() || decryptionKeys.get() != null) {
EncryptedJwt encryptedJwt = EncryptedJwt.parseToken(headers, token);
if (!headers.contentType().map("JWT"::equals).orElse(false)) {
throw new JwtException("Header \"cty\" (content type) must be set to \"JWT\" "
Expand Down
6 changes: 0 additions & 6 deletions microprofile/tests/tck/tck-jwt-auth/tck-base-suite.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@
<exclude name="testNeedsGroup1Mapping"/>
</methods>
</class>
<!-- There is no reason why this should fail -->
<class name="org.eclipse.microprofile.jwt.tck.container.jaxrs.jwe.RolesAllowedSignEncryptTest">
<methods>
<exclude name="callEchoSignToken"/>
</methods>
</class>
</classes>
</test>
</suite>

0 comments on commit e21d85f

Please sign in to comment.