I think the problem is that SessionManager#logout
(which programmatically logs out the user e.g. HttpServletRequest#logout))
is invoked before invoking
LoginHistoryService#create. SessionManager is a CDI bean and LoginHistoryService is SLSB. I think the "Invalid User" is a result of logout removing the principal prior to invoking create on the SLSB.
I'm looking into it, but want to let you know now what I think the problem is before you waste time on this.