use of org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProvider in project jackrabbit-oak by apache.
the class LdapProviderTest method testAuthenticateValidateFalseTrue.
@Test
public void testAuthenticateValidateFalseTrue() throws Exception {
providerConfig.getAdminPoolConfig().setMaxActive(2).setLookupOnValidate(false);
providerConfig.getUserPoolConfig().setMaxActive(2).setLookupOnValidate(true);
idp.close();
idp = new LdapIdentityProvider(providerConfig);
SimpleCredentials creds = new SimpleCredentials(TEST_USER1_UID, "pass".toCharArray());
for (int i = 0; i < 8; i++) {
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.security.authentication.ldap.impl.LdapIdentityProvider in project jackrabbit-oak by apache.
the class LdapProviderTest method testAuthenticateValidateTrueFalse.
@Test
public void testAuthenticateValidateTrueFalse() throws Exception {
providerConfig.getAdminPoolConfig().setMaxActive(2).setLookupOnValidate(true);
providerConfig.getUserPoolConfig().setMaxActive(2).setLookupOnValidate(false);
idp.close();
idp = new LdapIdentityProvider(providerConfig);
SimpleCredentials creds = new SimpleCredentials(TEST_USER1_UID, "pass".toCharArray());
for (int i = 0; i < 8; i++) {
ExternalUser user = idp.authenticate(creds);
assertNotNull("User 1 must authenticate (i=" + i + ")", user);
assertEquals("User Ref", TEST_USER1_DN, user.getExternalId().getId());
}
}
use of org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProvider in project jackrabbit-oak by apache.
the class LdapProviderTest method testAuthenticateValidateTrueTrue.
@Test
public void testAuthenticateValidateTrueTrue() throws Exception {
providerConfig.getAdminPoolConfig().setMaxActive(2).setLookupOnValidate(true);
providerConfig.getUserPoolConfig().setMaxActive(2).setLookupOnValidate(true);
idp.close();
idp = new LdapIdentityProvider(providerConfig);
SimpleCredentials creds = new SimpleCredentials(TEST_USER1_UID, "pass".toCharArray());
for (int i = 0; i < 8; i++) {
ExternalUser user = idp.authenticate(creds);
assertNotNull("User 1 must authenticate (i=" + i + ")", user);
assertEquals("User Ref", TEST_USER1_DN, user.getExternalId().getId());
}
}
use of org.apache.jackrabbit.oak.security.authentication.ldap.impl.LdapIdentityProvider in project jackrabbit-oak by apache.
the class LdapProviderTest method testAuthenticateValidateFalseFalse.
@Test
public void testAuthenticateValidateFalseFalse() throws Exception {
providerConfig.getAdminPoolConfig().setMaxActive(2).setLookupOnValidate(false);
providerConfig.getUserPoolConfig().setMaxActive(2).setLookupOnValidate(false);
idp.close();
idp = new LdapIdentityProvider(providerConfig);
SimpleCredentials creds = new SimpleCredentials(TEST_USER1_UID, "pass".toCharArray());
for (int i = 0; i < 8; i++) {
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.security.authentication.ldap.impl.LdapIdentityProvider in project jackrabbit-oak by apache.
the class LargeLdapProviderTest method createIDP.
protected LdapIdentityProvider createIDP() {
providerConfig = new LdapProviderConfig().setName(IDP_NAME).setHostname("127.0.0.1").setPort(LDAP_SERVER.getPort()).setBindDN(USER_DN).setBindPassword(USER_PWD).setGroupMemberAttribute("member");
providerConfig.getUserConfig().setBaseDN(AbstractServer.EXAMPLE_DN).setObjectClasses("inetOrgPerson");
providerConfig.getGroupConfig().setBaseDN(AbstractServer.EXAMPLE_DN).setObjectClasses(InternalLdapServer.GROUP_CLASS_ATTR);
providerConfig.getAdminPoolConfig().setMaxActive(0);
providerConfig.getUserPoolConfig().setMaxActive(0);
return new LdapIdentityProvider(providerConfig);
}
Aggregations