ElytronSessionTokenStore#logoutHttpSessions() does not work as expected due to UNDERTOW-2159 (#16501)
Closes #16465
This commit is contained in:
parent
7d6e22bedd
commit
3b6dc5152e
1 changed files with 26 additions and 20 deletions
|
@ -220,10 +220,13 @@ public class ElytronSessionTokenStore implements ElytronTokeStore, UserSessionMa
|
|||
HttpServerExchange exchange = ProtectedHttpServerExchange.class.cast(httpFacade.getScope(Scope.EXCHANGE).getAttachment(UNDERTOW_EXCHANGE)).getExchange();
|
||||
ServletRequestContext servletRequestContext = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
|
||||
SessionManager sessionManager = servletRequestContext.getDeployment().getSessionManager();
|
||||
final boolean isDistributableSessionManager = sessionManager.getClass().getName().equals("org.wildfly.clustering.web.undertow.session.DistributableSessionManager");
|
||||
|
||||
for (String id : ids) {
|
||||
// TODO: Workaround for WFLY-3345. Remove this once we fix KEYCLOAK-733. Same applies to legacy wildfly adapter.
|
||||
Session session = sessionManager.getSession(null, new SessionConfig() {
|
||||
Session session;
|
||||
if (isDistributableSessionManager) {
|
||||
session = sessionManager.getSession(exchange, new SessionConfig() {
|
||||
|
||||
@Override
|
||||
public void setSessionId(HttpServerExchange exchange, String sessionId) {
|
||||
|
@ -249,6 +252,9 @@ public class ElytronSessionTokenStore implements ElytronTokeStore, UserSessionMa
|
|||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
session = sessionManager.getSession(id);
|
||||
}
|
||||
|
||||
if (session != null) {
|
||||
session.invalidate(exchange);
|
||||
|
|
Loading…
Reference in a new issue