KEYCLOAK-3514 : Don't call logout for bearer-only client

This commit is contained in:
sebastien blanc 2016-11-02 11:39:37 +01:00
parent 69dddfa73a
commit d98c375495

View file

@ -92,7 +92,7 @@ public abstract class AbstractUndertowKeycloakAuthMech implements Authentication
UndertowHttpFacade facade = createFacade(exchange); UndertowHttpFacade facade = createFacade(exchange);
KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade); KeycloakDeployment deployment = deploymentContext.resolveDeployment(facade);
KeycloakSecurityContext ksc = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY); KeycloakSecurityContext ksc = exchange.getAttachment(OIDCUndertowHttpFacade.KEYCLOAK_SECURITY_CONTEXT_KEY);
if (ksc != null && ksc instanceof RefreshableKeycloakSecurityContext) { if (!deployment.isBearerOnly() && ksc != null && ksc instanceof RefreshableKeycloakSecurityContext) {
((RefreshableKeycloakSecurityContext) ksc).logout(deployment); ((RefreshableKeycloakSecurityContext) ksc).logout(deployment);
} }
AdapterTokenStore tokenStore = getTokenStore(exchange, facade, deployment, securityContext); AdapterTokenStore tokenStore = getTokenStore(exchange, facade, deployment, securityContext);