mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-23 04:22:17 +00:00
Fixed NPE see SEC-143
This commit is contained in:
parent
38629f159a
commit
b20c0a674a
@ -421,8 +421,12 @@ public class JaasAuthenticationProvider implements AuthenticationProvider,
|
|||||||
*/
|
*/
|
||||||
protected void handleLogout(HttpSessionDestroyedEvent event) {
|
protected void handleLogout(HttpSessionDestroyedEvent event) {
|
||||||
SecurityContext context = (SecurityContext) event.getSession().getAttribute(HttpSessionContextIntegrationFilter.ACEGI_SECURITY_CONTEXT_KEY);
|
SecurityContext context = (SecurityContext) event.getSession().getAttribute(HttpSessionContextIntegrationFilter.ACEGI_SECURITY_CONTEXT_KEY);
|
||||||
|
if (context == null) {
|
||||||
|
log.debug("The destroyed session has no SecurityContext");
|
||||||
|
return;
|
||||||
|
}
|
||||||
Authentication auth = context.getAuthentication();
|
Authentication auth = context.getAuthentication();
|
||||||
if (auth instanceof JaasAuthenticationToken) {
|
if ((auth != null) && (auth instanceof JaasAuthenticationToken)) {
|
||||||
JaasAuthenticationToken token = (JaasAuthenticationToken) auth;
|
JaasAuthenticationToken token = (JaasAuthenticationToken) auth;
|
||||||
try {
|
try {
|
||||||
LoginContext loginContext = token.getLoginContext();
|
LoginContext loginContext = token.getLoginContext();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user