You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2022/01/14 20:06:55 UTC
[activemq-artemis] 20/47: ARTEMIS-3567 Fix IllegalStateException on web console logout
This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch 2.19.x
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 00eb7e61938aec2795c9a3be2485cc0252d3266e
Author: Domenico Francesco Bruscino <br...@apache.org>
AuthorDate: Thu Nov 11 11:24:19 2021 +0100
ARTEMIS-3567 Fix IllegalStateException on web console logout
(cherry picked from commit 8635eb65eb8612d89e84dcb87b7a9b7b529fbcc7)
---
.../apache/activemq/artemis/component/AuthenticationFilter.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java b/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java
index 7f395b7..6a94d7c 100644
--- a/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java
+++ b/artemis-web/src/main/java/org/apache/activemq/artemis/component/AuthenticationFilter.java
@@ -45,8 +45,11 @@ public class AuthenticationFilter implements Filter {
int status = ((Response) servletResponse).getStatus();
//status 200 means that the user has been authenticated, anything else must be a failure
if (status == 200) {
- HttpSession session = ((Request) servletRequest).getSession();
- AuditLogger.userSuccesfullyAuthenticatedInAudit(session != null ? (Subject) session.getAttribute("subject") : null);
+ //the hawtio logout servlet cleans the session and redirects to the login servlet
+ HttpSession session = ((Request) servletRequest).getSession(false);
+ if (session != null) {
+ AuditLogger.userSuccesfullyAuthenticatedInAudit(session != null ? (Subject) session.getAttribute("subject") : null);
+ }
} else {
AuditLogger.userFailedAuthenticationInAudit("" + status);
}