DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • How To Integrate Chatbot With an Android App
  • Guide for Voice Search Integration to Your Flutter Streaming App
  • Integration of Cross-Platform Features in Native Mobile Apps
  • How To Integrate a Web Component Into a Mobile App While Preserving Native UX

Trending

  • Medallion Architecture: Why You Need It and How To Implement It With ClickHouse
  • Docker Model Runner: Streamlining AI Deployment for Developers
  • How to Convert XLS to XLSX in Java
  • AI-Driven Test Automation Techniques for Multimodal Systems
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. OpenLDAP and Camunda-Spring Boot App Integration in Windows

OpenLDAP and Camunda-Spring Boot App Integration in Windows

A developer gives a step-by-step tutorial on how to create an Open LDAP application and integrate it into an existing app running on Camunda and Spring Boot.

By 
Alok Singh user avatar
Alok Singh
DZone Core CORE ·
Updated Feb. 10, 21 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
18.0K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we'll take a look at a working example of a Camunda-Spring Boot application, going over how to integrate it with LDAP, how to easily check-in with your local setup, and how to use these concepts in higher environments in your projects.

Prerequisites

To test Open LDAP Integration with Camunda on your local Windows machine, you need to have the below tools/software:

  1. Open LDAP for Windows.
  2. Apache Directory Studio (ApacheDS).
  3. Eclipse (for development) with Maven.
  4. Spring Boot 2.0.
  5. Java 8+.

Installing Open LDAP

Download Open LDAP for Windows here. Click on the .exe file to install it. Open LDAP provides five different database options:

  1. BDB (Berkley Database)
  2. MDB (Memory Mapped Database)
  3. LDAP (a proxy ahead of the actual LDAP server)
  4. LDIF (use of LDIF files)
  5. SQL Server 

For this exercise, choose BDB while installing Open LDAP. Make a note to remember the password and Hostname that you set during installation and make sure the service is running on your machine.

Configuring the User Directory Using Apache Directory Studio

Download Apache Directory Studio from here and install it on your machine. Open it up and follow the below steps to complete the configuration.

  1. Open Apache DS. Click on the LDAP -> New Connection menu item. Enter the connection name of your choice along with the Hostname, which is the same as the Hostname we entered while installing Open LDAP. 
  2. Enter the user as cn=Manager,dc=maxcrc,dc=com; the password should be the same as the password you created while installing Open LDAP. 
  3. With this connection setup, the next step is to try to create users for Apache Directory Studio. The connection will look like this: Right click on ou=people and select the option "New Entry" -> Next -> "inetOrgPerson"-> Next. 
  4. The next step is to create some common names under which we can add multiple users. For this, set the value of RDN to cn and give it a value (for this example, "reviewer"). Then click on Next and Finish. If any other value needs to be added feel free to do so. 
  5. To add users in cn=reviewer, repeat steps 4 and 5 and then choose RDN as the uid and provide it with a value. 

You can add other values to it, such as mail, mobile, and userPassword, by clicking on the + symbol.

Now, you have created a user in Open LDAP that can be used to connect to a Camunda application.

Integrating a Camunda Application With Open LDAP

Open your Camunda-Spring Boot Application. If don't have one created, you can use this link to create one.

Add the below LDAP-related dependency to your pom.xml file.

XML
 




xxxxxxxxxx
1
19


 
1
<dependency> 
2
            <groupId>org.camunda.bpm.identity</groupId> 
3
            <artifactId>camunda-identity-ldap</artifactId> 
4
            <version>${camunda-version}</version> 
5
        </dependency>
6
        <dependency> 
7
            <groupId>org.springframework.data</groupId> 
8
            <artifactId>spring-data-ldap</artifactId> 
9
        </dependency> 
10
        <dependency> 
11
            <groupId>org.springframework.ldap</groupId> 
12
            <artifactId>spring-ldap-core</artifactId> 
13
            <exclusions> 
14
                <exclusion> 
15
                    <groupId>commons-logging</groupId> 
16
                    <artifactId>commons-logging</artifactId> 
17
                </exclusion> 
18
            </exclusions> 
19
        </dependency>


Add the below Java code to enable the connection between LDAP and the configuration, as shown below:

Java
 




x


 
1
package com.security;
2
3
import org.camunda.bpm.engine.impl.plugin.AdministratorAuthorizationPlugin;
4
import org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin;
5
import org.springframework.context.annotation.Bean;
6
import org.springframework.context.annotation.Configuration;
7
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
8
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
9
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
10
11
@EnableWebSecurity
12
@Configuration
13
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
14
15
    @Override
16
    protected void configure(HttpSecurity http) throws Exception {
17
        http.csrf().disable();
18
        http.authorizeRequests().antMatchers("/").permitAll(); 
19
        http.headers().frameOptions().disable();
20
    }
21
    
22
    @Bean
23
    public static AdministratorAuthorizationPlugin administratorAuthorizationPlugin() {
24
        AdministratorAuthorizationPlugin plugin = new AdministratorAuthorizationPlugin();
25
        plugin.setAdministratorUserName("alok.singh");
26
        return plugin;
27
    }
28
    
29
    @Bean
30
    public static LdapIdentityProviderPlugin ldapIdentityProviderPlugin() {
31
        LdapIdentityProviderPlugin plugin = new LdapIdentityProviderPlugin();
32
        plugin.setServerUrl("ldap://localhost:389");
33
        plugin.setManagerDn("cn=Manager,dc=maxcrc,dc=com");
34
        plugin.setManagerPassword("secret");
35
        plugin.setBaseDn("ou=People,dc=maxcrc,dc=com");
36
        //plugin.setUserSearchBase("ou=People");
37
        plugin.setUserSearchFilter("(objectclass=person)");
38
        plugin.setUserIdAttribute("uid");
39
        plugin.setUserFirstnameAttribute("cn");
40
        plugin.setUserLastnameAttribute("sn");
41
        plugin.setUserPasswordAttribute("userPassword");
42
        //plugin.setGroupSearchBase("ou=Gruppen");
43
        //plugin.setGroupSearchFilter("(member={0})");
44
        //plugin.setGroupIdAttribute("ou");
45
        //plugin.setGroupNameAttribute("cn");
46
        //plugin.setGroupMemberAttribute("member");
47
        //plugin.setAuthorizationCheckEnabled(true);
48
        return plugin;
49
    }   
50
}


YAML
 




xxxxxxxxxx
1


 
1
ldap:
2
  principal: cn=Manager,dc=maxcrc,dc=com
3
  password: secret
4
  port: 389
5
  url: ldap://localhost:389


Start the Sprint Boot application and use the given username/password to login to your Camunda web app (http://localhost:8080/app/welcome) using the same username/password you created while configuring a user in OpenLDAP.

mobile app Integration Apache Directory

Opinions expressed by DZone contributors are their own.

Related

  • How To Integrate Chatbot With an Android App
  • Guide for Voice Search Integration to Your Flutter Streaming App
  • Integration of Cross-Platform Features in Native Mobile Apps
  • How To Integrate a Web Component Into a Mobile App While Preserving Native UX

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!