Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
JENKINS-52306 Improve SSO logout, continuous fix for JENKINS-11507
Browse files Browse the repository at this point in the history
  • Loading branch information
gmshake committed Apr 21, 2022
1 parent be3c377 commit 8fd94d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/de/theit/jenkins/crowd/CrowdServletFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ public void doFilter(ServletRequest request, ServletResponse response,
LOG.fine("User sucessfully logged in");
}
sc.setAuthentication(auth);
} else { // Auto login failed.
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("User failed to log in");
}
HttpSession session = req.getSession(false);
if (session != null) {
session.invalidate();
}
SecurityContextHolder.clearContext();
}
}
}
Expand Down

0 comments on commit 8fd94d9

Please sign in to comment.