@Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { mapWithContext(ctx, ldapEntryIdentification); }
@Test @Category(NoAdTest.class) public void testAuthenticateWithLdapQueryAndMapper() { DirContextOperations ctx = tested.authenticate(query() .where("objectclass").is("person") .and("uid").is("some.person3"), "password", new LookupAttemptingCallback()); assertThat(ctx).isNotNull(); assertThat(ctx.getStringAttribute("uid")).isEqualTo("some.person3"); }
@Test @Category(NoAdTest.class) public void testLookupAttemptingCallback() { AndFilter filter = new AndFilter(); filter.and(new EqualsFilter("objectclass", "person")).and(new EqualsFilter("uid", "some.person3")); LookupAttemptingCallback callback = new LookupAttemptingCallback(); assertThat(tested.authenticate("", filter.encode(), "password", callback)).isTrue(); } }
@Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { mapWithContext(ctx, ldapEntryIdentification); }
@Test(expected = AuthenticationException.class) @Category(NoAdTest.class) public void testAuthenticateWithLdapQueryAndMapperAndInvalidPassword() { DirContextOperations ctx = tested.authenticate(query() .where("objectclass").is("person") .and("uid").is("some.person3"), "invalidpassword", new LookupAttemptingCallback()); }
@Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { mapWithContext(ctx, ldapEntryIdentification); }
@Override public void executeWithContext(DirContext ctx, LdapEntryIdentification ldapEntryIdentification) { mapWithContext(ctx, ldapEntryIdentification); }