From 6c83b36360e9ebc93867e74d980e428b136ae056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20S=C3=B6nder?= Date: Tue, 15 Oct 2019 16:40:11 +0200 Subject: [PATCH] Do not log when failure.getError is blank/empty Sometimes the error message is blank, which results in an empty error line getting logged. Since the catch always logs "failed to turn code into token" and "status from server: " + failure.getStatus() (on separate lines) this extra blank line is simply noise in the log. --- .../java/org/keycloak/adapters/OAuthRequestAuthenticator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java index 2e9ad31ca0..38a2dfe22a 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/OAuthRequestAuthenticator.java @@ -336,7 +336,7 @@ public class OAuthRequestAuthenticator { } catch (ServerRequest.HttpFailure failure) { log.error("failed to turn code into token"); log.error("status from server: " + failure.getStatus()); - if (failure.getError() != null) { + if (failure.getError() != null && !failure.getError().isBlank()) { log.error(" " + failure.getError()); } return challenge(403, OIDCAuthenticationError.Reason.CODE_TO_TOKEN_FAILURE, null);