KEYCLOAK-15242 Error in application logs when refresh token is expired.

This commit is contained in:
Martin Bartoš 2020-11-03 13:27:21 +01:00 committed by Marek Posolda
parent a01dcc5456
commit da6c59f0c3

View file

@ -143,7 +143,8 @@ public class RefreshableKeycloakSecurityContext extends KeycloakSecurityContext
log.error("Refresh token failure", e); log.error("Refresh token failure", e);
return false; return false;
} catch (ServerRequest.HttpFailure httpFailure) { } 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; return false;
} }
if (log.isTraceEnabled()) { if (log.isTraceEnabled()) {