use of org.onebusaway.everylastlogin.server.AuthenticationResult in project onebusaway-application-modules by camsys.
the class EveryLastLoginAuthenticationProcessorFilter method attemptAuthentication.
@Override
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException, IOException, ServletException {
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);
return new DefaultUserAuthenticationToken(details);
}
Aggregations