File tree Expand file tree Collapse file tree
src/main/java/eu/openanalytics/containerproxy/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141import org .springframework .security .core .GrantedAuthority ;
4242import org .springframework .security .core .context .SecurityContext ;
4343import org .springframework .security .core .context .SecurityContextHolder ;
44- import org .springframework .security .core .userdetails .User ;
4544import org .springframework .security .web .session .HttpSessionCreatedEvent ;
4645import org .springframework .security .web .session .HttpSessionDestroyedEvent ;
4746import org .springframework .stereotype .Service ;
@@ -230,8 +229,7 @@ public void onHttpSessionDestroyedEvent(HttpSessionDestroyedEvent event) {
230229 SecurityContext securityContext = event .getSecurityContexts ().get (0 );
231230 if (securityContext == null ) return ;
232231
233- Authentication authentication = securityContext .getAuthentication ();
234- String userId = ((User ) authentication .getPrincipal ()).getUsername ();
232+ String userId = securityContext .getAuthentication ().getName ();
235233
236234 log .info (String .format ("User logged out [user: %s]" , userId ));
237235 applicationEventPublisher .publishEvent (new UserLogoutEvent (
You can’t perform that action at this time.
0 commit comments