Ldap + SpringBoot Maven Archetype

Hello, I am working with maven archetype version of spring boot. I decided to log in to camunda witch ldap. So, based on this link [Manual Installation Ldap] (Configure the Full Distribution for Tomcat | docs.camunda.org)

The first step was to try using the xml with my data as it is in the example. And work perfectly. The problem was when I wanted to translate that into a spring boot version.

The Second step is translate to spring boot version. So, I need to create two beans and add this to process engine plugin list. One of this bean are the ldapPLugin.

My code is this:

package Ldap.Camunda.Configuration;

import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration;
import org.camunda.bpm.engine.impl.persistence.StrongUuidGenerator;
import org.camunda.bpm.engine.impl.plugin.AdministratorAuthorizationPlugin;
import org.camunda.bpm.engine.spring.SpringProcessEngineConfiguration;
import org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class LdapCustomConfiguration extends StandaloneInMemProcessEngineConfiguration {

@Bean
public SpringProcessEngineConfiguration springProcessEngineConfiguration() {
	SpringProcessEngineConfiguration processEngineConfigurationInstance = new SpringProcessEngineConfiguration();
	processEngineConfigurationInstance.setIdGenerator(new StrongUuidGenerator());

	processEnginePlugins.add(ldapIdentityProviderPlugin());
	processEnginePlugins.add(administratorAuthorizationPlugin());

	return processEngineConfigurationInstance;
}

@Bean
public LdapIdentityProviderPlugin ldapIdentityProviderPlugin() {

	LdapIdentityProviderPlugin ldapIdentityProviderPlugin = new LdapIdentityProviderPlugin();

	ldapIdentityProviderPlugin.setServerUrl("ldaps://someEndpoint:636");
	ldapIdentityProviderPlugin.setAcceptUntrustedCertificates(true);
	ldapIdentityProviderPlugin.setManagerDn("someValues");
	ldapIdentityProviderPlugin.setManagerPassword("password");
	ldapIdentityProviderPlugin.setBaseDn("someValues");
	ldapIdentityProviderPlugin.setUserSearchBase("");
	ldapIdentityProviderPlugin.setUserSearchFilter("(objectclass=person)");
	ldapIdentityProviderPlugin.setUserIdAttribute("uid");
	ldapIdentityProviderPlugin.setUserFirstnameAttribute("givenName");
	ldapIdentityProviderPlugin.setUserLastnameAttribute("sn");
	ldapIdentityProviderPlugin.setUserEmailAttribute("mail");
	ldapIdentityProviderPlugin.setUserPasswordAttribute("userPassword");
	ldapIdentityProviderPlugin.setGroupSearchBase("OU=GruposAplicaciones,OU=GruposDeDominio");
	ldapIdentityProviderPlugin.setGroupSearchFilter("(objectclass=*)");
	ldapIdentityProviderPlugin.setGroupIdAttribute("CN");
	ldapIdentityProviderPlugin.setGroupNameAttribute("cn");
	ldapIdentityProviderPlugin.setGroupMemberAttribute("member");
	ldapIdentityProviderPlugin.setSortControlSupported(false);

	return ldapIdentityProviderPlugin;
}

@Bean
public AdministratorAuthorizationPlugin administratorAuthorizationPlugin() {
	AdministratorAuthorizationPlugin administratorAuthorizationPlugin = new AdministratorAuthorizationPlugin();
	administratorAuthorizationPlugin.setAdministratorUserName("superAdminUserName");
	return administratorAuthorizationPlugin;
}

}

This is my pom

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

Ldap.Camunda
Wizard
0.0.1-SNAPSHOT

Camunda Spring Boot Application
Spring Boot Application using Camunda. [The project has been generated by the Maven archetype ‘camunda-archetype-spring-boot-7.11.1’]

7.11.0 3.3.1 2.1.5.RELEASE
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<version.java>1.8</version.java>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
org.camunda.bpm camunda-bom ${camunda.version} import pom org.springframework.boot spring-boot-dependencies ${springBoot.version} pom import org.camunda.bpm.springboot camunda-bpm-spring-boot-starter-webapp ${camundaSpringBoot.version}
<dependency>
  <groupId>org.camunda.bpm.springboot</groupId>
  <artifactId>camunda-bpm-spring-boot-starter-rest</artifactId>
  <version>${camundaSpringBoot.version}</version>
</dependency>

<dependency>
  <groupId>org.camunda.bpm.springboot</groupId>
  <artifactId>camunda-bpm-spring-boot-starter-test</artifactId>
  <version>${camundaSpringBoot.version}</version>
</dependency>

<dependency>
  <groupId>com.microsoft.sqlserver</groupId>
  <artifactId>sqljdbc4</artifactId>
  <version>4.0</version>
</dependency>

<dependency>
    <groupId>org.camunda.connect</groupId>
    <artifactId>camunda-connect-http-client</artifactId>
</dependency>

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

<!-- Required to use Spin dataformat support -->
<dependency>
  <groupId>org.camunda.spin</groupId>
  <artifactId>camunda-spin-dataformat-all</artifactId>
</dependency>
<dependency>
  <groupId>org.camunda.bpm</groupId>
  <artifactId>camunda-engine-plugin-spin</artifactId>
</dependency>

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-test</artifactId>
  <scope>test</scope>
</dependency>

<dependency>
  <groupId>org.camunda.bpm.extension</groupId>
  <artifactId>camunda-bpm-assert-scenario</artifactId>
  <version>0.2</version>
  <scope>test</scope>
</dependency>

<!-- java util logging => slf4j -->
<dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>jul-to-slf4j</artifactId>
  <scope>test</scope>
</dependency>

<!-- Add your own dependencies here, if in compile scope, they are added to the jar -->
<dependency>
  <groupId>org.camunda.bpm.identity</groupId>
  <artifactId>camunda-identity-ldap</artifactId>
</dependency>
camunda-bpm-nexus Camunda Maven Repository https://app.camunda.com/nexus/content/groups/public ${project.artifactId} org.springframework.boot spring-boot-maven-plugin ${springBoot.version} ZIP repackage org.codehaus.mojo exec-maven-plugin 1.6.0 Ldap.Camunda.Wizard.CamundaApplication

My yaml file is this:
spring.datasource:
url: jdbc:sqlserver://someEndpoint:1433;databaseName=camunda;
username: someUser
password: somePassUser
driverclassname: com.microsoft.sqlserver.jdbc.SQLServerDriver
server.port: 8080
logging.level.org.camunda.bpm.identity.impl.ldap: DEBUG

When I try access The page show this:

So, if I create the user, it is created in the database but never signs in with the ldap service. In fact login by database user and never witch ldap.

Please help me

Hey @bullCamunda,

welcome to the forum.
I am not entirely certain to be honest, but you might be running into this issue here where custom engine plugins in Spring Boot are overridden. It has been resolved in later versions than you are presumably using:

https://jira.camunda.com/browse/CAM-10650

Can you please try to use a newer version of the Camunda Spring Boot Starter?

Best,
Tobias

The problem was that the configuration done in LdapCustomConfiguration was not in the same folder of the springBootaplication class, so never loading this conf. But while now connect with ldap, the only user recognizes is that determined in AdministratorAuthorizationPlugin, userName. Once you enter to the application it does not show any group.