public Authentication attemptAuthentication(HttpServletRequest request)
throws AuthenticationException {
String mode = request.getParameter("mode");
AuthenticationResult result = LoginManager.getResult(request);
if (result == null)
throw new EveryLastLoginAuthenticationException(
"AuthenticationResult not found", mode);
if (result.getCode() != EResultCode.SUCCESS)
throw new EveryLastLoginAuthenticationException(
"AuthenticationResult failure", mode);
IndexedUserDetails details = _currentUserService.handleUserAction(
result.getProvider(), result.getIdentity(), result.getCredentials(),
false, mode);
if (details == null)
throw new EveryLastLoginAuthenticationException("could not get user details", mode);