Configuring Keycloak with LDAP and TLS Certificate (LDAPS) in NetEye
In this article I’ll guide you step-by-step through configuring Keycloak to connect to an LDAP server using a secure LDAPS (SSL/TLS) connection, with support for certificates signed by either internal or self-signed Certificate Authorities. This is especially useful in enterprise environments using Active Directory or a centralized LDAP server.
This configuration is particularly relevant for environments using NetEye, as NetEye relies on Keycloak for centralized authentication and supports integration with LDAP directories for user federation and access control.
Requirements
Access to an LDAP server (e.g., OpenLDAP or Microsoft AD)
Root/intermediate certificate used by the LDAP server
Root/sudo access on the system running Keycloak
A working NetEye environment that uses Keycloak as its identity provider
1. Obtain the LDAP Server Certificate
Extract the LDAP server certificate (or the root CA that signed it). If you don’t already have it, you can retrieve it using openssl:
Check the logs: /opt/keycloak/logs/server.log or journalctl -fu keycloak
Ensure the certificate’s CN or SAN matches the LDAP hostname
6. Final Test
Try logging into Keycloak with an LDAP user. If everything is configured correctly, authentication should succeed.
Then log into NetEye using the same user: you should be authenticated via Keycloak and redirected successfully.
Conclusion
Connecting Keycloak to an LDAP server via LDAPS significantly enhances authentication infrastructure security. This is especially important in NetEye environments, where centralized identity and access management is critical.
These Solutions are Engineered by Humans
Did you find this article interesting? Does it match your skill set? Programming is at the heart of how we develop customized solutions. In fact, we’re currently hiring for roles just like this and others here at Würth Phoenix.
My name is Alessandro Paoli and I've been a Technical Consultant at Wurth Phoenix since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies.
I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).
Author
Alessandro Paoli
My name is Alessandro Paoli and I've been a Technical Consultant at Wurth Phoenix since May 2024. I've always had a great passion for IT and since 2004 it has also become my job. In 2015 I found my role in the field, monitoring. I have had the opportunity to use various monitoring products, both open source and proprietary, I have worked on numerous projects from small businesses to global companies.
I am married and have 2 wonderful daughters. My passions are travel, cinema, games (video and board) and comics, and every now and then I manage to indulge in a few days of sport (Padel and gym).
While working on some internal tools, I needed secure access to a few PHP pages and virtual directories resources that, by default, didn’t have any built-in access control. Since NetEye already uses Keycloak as its authentication system, I decided to Read More
Starting in March 2020, Microsoft will release an update which includes hardening measures for LDAP binding. Read the full advisory here: https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/ADV190023 . This affects all of us who still use plain LDAP to perform queries in Active Directory. Starting Read More
The Safed agent can be configured via https and send its collected logs to the log collector though a TLS connection. The latest released version - 1.9.1 - supports TLS 1.2 (at a minimum) and TLS 1.3. The first step Read More
A new feature since version 1.8 of the "Real User Experience" (RUE) is the integration with your LDAP server, which helps you associating network requests to specific users. This is possible if you are monitoring services like the Microsoft Outlook Read More
We extended the basic LDAP check contained in the standard plugins to monitor specific attributes of a given LDAP search. This allows to actively monitor the LDAP database consistency, tracking unwanted changes. Download: check_ldap_search