public boolean authenticate(final String username, final String password) { try { final boolean authenticated = authenticator.authenticate(username, password); if (!authenticated) { log.info("Cannot authenticate user '" + username + "' as they used an incorrect password"); } return authenticated; } catch (final EntityException e) { log.info("Cannot authenticate user '" + username + "' as they do not exist."); return false; } }
private boolean authenticate(Authenticator authenticator, String username, String password) { try { return authenticator.authenticate(username, password); } catch (EntityException e) { log.error(authenticator.getRepository() + ": " + e.getMessage()); return false; } }
private List<Authenticator> getAuthenticatorsForRepository(RepositoryIdentifier repository) { return authenticators.stream() .filter(authenticator -> authenticator.getRepository().equals(repository)) .collect(Collectors.toCollection(LinkedList::new)); }
@Override public boolean authenticate(String username, String password) throws EntityException { User user = userManager.getUser(username); if (user == null) return false; if (!(user instanceof DefaultUser)) return false; if (!user.isEnabled()) { log.info("User '" + username + "' is disabled, so can't be authenticated"); return false; } DefaultUser defaultUser = (DefaultUser) user; try { return defaultUser.getPassword() != null && defaultUser.getPassword().equals(encryptor.encrypt(password)); } catch (Exception e) { throw new EntityAuthenticationException(e); } }
public boolean authenticate(final String username, final String password) { try { final boolean authenticated = authenticator.authenticate(username, password); if (!authenticated) { log.info("Cannot authenticate user '" + username + "' as they used an incorrect password"); } return authenticated; } catch (final EntityException e) { log.info("Cannot authenticate user '" + username + "' as they do not exist."); return false; } }
protected boolean authenticate(String username, String password) { try { boolean authenticated = authenticator.authenticate(username, password); if (authenticated) log.info("User '" + username + "' successfully logged in"); else log.info("Cannot login user '" + username + "' as they used an incorrect password"); return authenticated; } catch (EntityException e) { log.info("Cannot login user '" + username + "' as they do not exist."); return false; } } }
public boolean authenticate(final String username, final String password) { try { final boolean authenticated = authenticator.authenticate(username, password); if (!authenticated) { log.info("Cannot authenticate user '" + username + "' as they used an incorrect password"); } return authenticated; } catch (final EntityException e) { log.info("Cannot authenticate user '" + username + "' as they do not exist."); return false; } }