PasswordEncoder Bean for AuthenticationManagerBuilder

Issue: gh-4873
This commit is contained in:
Rob Winch
2017-11-27 10:57:28 -06:00
parent 9afee9e4e2
commit 691bf2e11d
6 changed files with 248 additions and 18 deletions

View File

@@ -483,7 +483,7 @@ public class DaoAuthenticationProviderTests {
// SEC-2056
@Test
public void testUserNotFoundEncodesPassword() {
public void testUserNotFoundEncodesPassword() throws Exception {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
"missing", "koala");
PasswordEncoder encoder = mock(PasswordEncoder.class);
@@ -492,6 +492,7 @@ public class DaoAuthenticationProviderTests {
provider.setHideUserNotFoundExceptions(false);
provider.setPasswordEncoder(encoder);
provider.setUserDetailsService(new MockAuthenticationDaoUserrod());
provider.afterPropertiesSet();
try {
provider.authenticate(token);
fail("Expected Exception");