@Test public void testAuthenticateBadUser() { AuthenticatedPrincipal principal = this.authenticator.authenticate("foo", PASSWORD); assertNull(principal); }
@Override public AuthenticatedPrincipal authenticate(String username, String password) { ResourceOwner user = resourceOwnerRepository.findByUsername(username); if (user == null) { return null; } if (!user.checkPassword(password)) { return null; } return new AuthenticatedPrincipal(username); }
LocalResourceOwnerAuthenticator implements ResourceOwnerAuthenticator { @Override public AuthenticatedPrincipal authenticate(String username, String password) { ResourceOwner user = resourceOwnerRepository.findByUsername(username); if (user == null) { return null; } if (!user.checkPassword(password)) { return null; } return new AuthenticatedPrincipal(username); } }
LocalResourceOwnerAuthenticator implements ResourceOwnerAuthenticator { @Override public AuthenticatedPrincipal authenticate(String username, String password) { ResourceOwner user = resourceOwnerRepository.findByUsername(username); if (user == null) { return null; } if (!user.checkPassword(password)) { return null; } return new AuthenticatedPrincipal(username); }  }
LocalResourceOwnerAuthenticator implements ResourceOwnerAuthenticator { @Override public AuthenticatedPrincipal authenticate(String username, String password) { ResourceOwner user = resourceOwnerRepository.findByUsername(username); if (user == null) { return null; } if (!user.checkPassword(password)) { return null; } return new AuthenticatedPrincipal(username); }  @Override AuthenticatedPrincipal authenticate(String username, String password); }
LocalResourceOwnerAuthenticator implements ResourceOwnerAuthenticator { @Override public AuthenticatedPrincipal authenticate(String username, String password) { ResourceOwner user = resourceOwnerRepository.findByUsername(username); if (user == null) { return null; } if (!user.checkPassword(password)) { return null; } return new AuthenticatedPrincipal(username); }  @Override AuthenticatedPrincipal authenticate(String username, String password);  }