use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser in project jackrabbit-oak by apache.
the class LdapProviderTest method testAuthenticateCaseInsensitive.
@Test
public void testAuthenticateCaseInsensitive() throws Exception {
SimpleCredentials creds = new SimpleCredentials(TEST_USER1_UID.toUpperCase(), "pass".toCharArray());
ExternalUser user = idp.authenticate(creds);
assertNotNull("User 1 must authenticate", user);
assertEquals("User Ref", TEST_USER1_DN, user.getExternalId().getId());
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser in project jackrabbit-oak by apache.
the class LdapProviderTest method testGetUserProperties.
@Test
public void testGetUserProperties() throws Exception {
ExternalUser user = idp.getUser(TEST_USER1_UID);
assertNotNull("User 1 must exist", user);
Map<String, ?> properties = user.getProperties();
assertThat((Map<String, Collection<String>>) properties, Matchers.<String, Collection<String>>hasEntry(Matchers.equalTo("objectclass"), Matchers.containsInAnyOrder("inetOrgPerson", "top", "person", "organizationalPerson")));
assertThat(properties, Matchers.<String, Object>hasEntry("uid", "hhornblo"));
assertThat(properties, Matchers.<String, Object>hasEntry("givenname", "Horatio"));
assertThat(properties, Matchers.<String, Object>hasEntry("description", "Capt. Horatio Hornblower, R.N"));
assertThat(properties, Matchers.<String, Object>hasEntry("sn", "Hornblower"));
assertThat(properties, Matchers.not(Matchers.<String, Object>hasEntry("mail", "hhornblo@royalnavy.mod.uk")));
}
use of org.apache.jackrabbit.oak.spi.security.authentication.external.ExternalUser in project jackrabbit-oak by apache.
the class LdapProviderTest method testSplitDNIntermediatePath.
@Test
public void testSplitDNIntermediatePath() throws Exception {
providerConfig.getUserConfig().setMakeDnPath(true);
ExternalUser user = idp.getUser(TEST_USER1_UID);
assertNotNull("User 1 must exist", user);
assertEquals("Intermediate path must be the split dn", TEST_USER1_PATH, user.getIntermediatePath());
}
Aggregations