[KEYCLOAK-7798] - Spring security adapter does not renew expired tokens

This commit is contained in:
Pedro Igor 2018-11-01 13:10:09 -03:00
parent 00cee1d8cf
commit 234b7a06a1

View file

@ -63,7 +63,7 @@ public class KeycloakSecurityContextRequestFilter extends GenericFilterBean impl
RefreshableKeycloakSecurityContext refreshableSecurityContext = (RefreshableKeycloakSecurityContext) keycloakSecurityContext; RefreshableKeycloakSecurityContext refreshableSecurityContext = (RefreshableKeycloakSecurityContext) keycloakSecurityContext;
KeycloakDeployment deployment = resolveDeployment(request, response); KeycloakDeployment deployment = resolveDeployment(request, response);
if (deployment.isAlwaysRefreshToken()) { if (!refreshableSecurityContext.isActive() || deployment.isAlwaysRefreshToken()) {
if (refreshableSecurityContext.refreshExpiredToken(false)) { if (refreshableSecurityContext.refreshExpiredToken(false)) {
request.setAttribute(KeycloakSecurityContext.class.getName(), refreshableSecurityContext); request.setAttribute(KeycloakSecurityContext.class.getName(), refreshableSecurityContext);
} else { } else {