use of org.springframework.security.ldap.server.ApacheDSContainer in project jBPM5-Developer-Guide by Salaboy.
the class ApacheDSServerStart method main.
public static void main(String[] args) throws Exception {
logger.info(" >>> Starting Apache DS LDAP Server ... ");
container = new ApacheDSContainer("o=mojo", "classpath:test.ldif");
container.setPort(9898);
container.afterPropertiesSet();
logger.info(" >>> Apache DS LDAP Server Started !");
}
use of org.springframework.security.ldap.server.ApacheDSContainer in project spring-security by spring-projects.
the class ApacheDSServerIntegrationTests method startServer.
@BeforeClass
public static void startServer() throws Exception {
// OpenLDAP configuration
// contextSource = new
// DefaultSpringSecurityContextSource("ldap://127.0.0.1:22389/dc=springsource,dc=com");
// contextSource.setUserDn("cn=admin,dc=springsource,dc=com");
// contextSource.setPassword("password");
server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif");
int port = getAvailablePort();
server.setPort(port);
server.afterPropertiesSet();
serverPort = port;
}
use of org.springframework.security.ldap.server.ApacheDSContainer in project jBPM5-Developer-Guide by Salaboy.
the class ProcessAndHumanTasksTest method setUp.
@Before
public void setUp() throws Exception {
container = new ApacheDSContainer("o=mojo", "classpath:identity-repository.ldif");
container.setPort(9898);
container.afterPropertiesSet();
LdapContextSource cs = new LdapContextSource();
cs.setUrl("ldap://localhost:9898/");
cs.setBase("o=mojo");
cs.setUserDn("uid=admin,ou=system");
cs.setPassword("secret");
cs.afterPropertiesSet();
LdapTemplate ldapTemplate = new LdapTemplate(cs);
ldapTemplate.afterPropertiesSet();
ldapQuery = new LdapQueryHelper(ldapTemplate);
// By Setting the jbpm.usergroup.callback property with the call
// back class full name, task service will use this to validate the
// user/group exists and its permissions are ok.
System.setProperty("jbpm.usergroup.callback", "org.jbpm.task.identity.LDAPUserGroupCallbackImpl");
// LdapUserGroupCallback callback = (LdapUserGroupCallback) UserGroupCallbackManager.getInstance().getCallback();
// callback.setQuery(ldapQuery);
}
use of org.springframework.security.ldap.server.ApacheDSContainer in project spring-security by spring-projects.
the class LdapServerBeanDefinitionParserTests method defaultLdifFileIsSuccessful.
@Test
public void defaultLdifFileIsSuccessful() {
appCtx = new InMemoryXmlApplicationContext("<ldap-server/>");
ApacheDSContainer dsContainer = appCtx.getBean(ApacheDSContainer.class);
assertThat(ReflectionTestUtils.getField(dsContainer, "ldifResources")).isEqualTo("classpath*:*.ldif");
}
use of org.springframework.security.ldap.server.ApacheDSContainer in project spring-security by spring-projects.
the class ApacheDSServerIntegrationTests method main.
/**
* Main class to allow server to be started from gradle script
*/
public static void main(String[] args) throws Exception {
ApacheDSContainer server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif");
server.afterPropertiesSet();
}
Aggregations