From da6c59f0c34939857f816fd9f0f121c1d9fab5b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Barto=C5=A1?= Date: Tue, 3 Nov 2020 13:27:21 +0100 Subject: [PATCH] KEYCLOAK-15242 Error in application logs when refresh token is expired. --- .../keycloak/adapters/RefreshableKeycloakSecurityContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java index 37f5f09bdf..c3b2e7155b 100755 --- a/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java +++ b/adapters/oidc/adapter-core/src/main/java/org/keycloak/adapters/RefreshableKeycloakSecurityContext.java @@ -143,7 +143,8 @@ public class RefreshableKeycloakSecurityContext extends KeycloakSecurityContext log.error("Refresh token failure", e); return false; } catch (ServerRequest.HttpFailure httpFailure) { - log.error("Refresh token failure status: " + httpFailure.getStatus() + " " + httpFailure.getError()); + final Logger.Level logLevel = httpFailure.getError().contains("Refresh token expired") ? Logger.Level.WARN : Logger.Level.ERROR; + log.log(logLevel, "Refresh token failure status: " + httpFailure.getStatus() + " " + httpFailure.getError()); return false; } if (log.isTraceEnabled()) {