Skip to content

Commit

Permalink
Fix the condition for logging empty JWK sets. (#91675) (#91678)
Browse files Browse the repository at this point in the history
The logic for check isEmpty should have been flipped. This PR fixes it.

Relates: #91001
  • Loading branch information
ywangd authored Nov 18, 2022
1 parent 57c80fa commit e7011ef
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ public void close() {
}

private void logWarnIfAuthenticationWillAlwaysFail() {
final boolean hasUsableJwksAndAlgorithms = (hmacJwtSignatureValidator != null && hmacJwtSignatureValidator.jwksAlgs.isEmpty())
|| (pkcJwtSignatureValidator != null && pkcJwtSignatureValidator.jwkSetLoader.getContentAndJwksAlgs().jwksAlgs().isEmpty());
final boolean hasUsableJwksAndAlgorithms = (hmacJwtSignatureValidator != null
&& false == hmacJwtSignatureValidator.jwksAlgs.isEmpty())
|| (pkcJwtSignatureValidator != null
&& false == pkcJwtSignatureValidator.jwkSetLoader.getContentAndJwksAlgs().jwksAlgs().isEmpty());
if (false == hasUsableJwksAndAlgorithms) {
logger.warn(
"No available JWK and algorithm for HMAC or PKC. JWT realm authentication expected to fail until this is fixed."
Expand Down

0 comments on commit e7011ef

Please sign in to comment.