@Nonnull @Override public AuthenticationDetails authenticate(Credentials credentials) throws LoginException { try { preprocessCredentials(credentials); //noinspection UnnecessaryLocalVariable AuthenticationDetails authenticationDetails = authenticationManager.authenticate(credentials); return authenticationDetails; } catch (InternalAuthenticationException ie) { log.error("Authentication error", ie); throw ie; } catch (LoginException e) { log.info("Authentication failed: {}", e.toString()); throw e; } catch (Throwable e) { log.error("Authentication error", e); throw wrapInLoginException(e); } }
@Override public User authenticate(String login, String password, Locale locale, Map<String, Object> params) throws LoginException { LoginPasswordCredentials credentials = new LoginPasswordCredentials(login, password, locale, params); copyParamsToCredentials(params, credentials); AuthenticationDetails sessionDetails = authenticationManager.authenticate(credentials); return sessionDetails.getSession().getUser(); }