---
title: "Advanced authentication for Data Grid in Red Hat OpenShift 4: LDAP and LDAPS"
description: "This article, part 2 of a series on securing Red Hat Data Grid on OpenShift 4, explains direct LDAP and LDAPS authentication against directory services using the Data Grid operator. The operator references a ConfigMap via spec.configMapName on the Infinispan custom resource to define LDAP server URLs, principal credentials, search DNs, and user role mappings. For LDAPS, the operator imports the directory server certificate into the pod truststore via a secret referenced by spec.security.endpointEncryption.clientCertSecretName, with clientCert set to None, Validate, or Authenticate to control mutual TLS. A test setup deploys OpenLDAP using a Helm chart and configures the security realm; the example uses hardcoded plaintext credentials, but production deployments should use encrypted keystores or OpenShift secrets. The author recommends LDAPS for production to encrypt credentials in transit and positions direct LDAP as a lean alternative to deploying a centralized SSO identity provider like Keycloak."
---

# Advanced authentication for Data Grid in Red Hat OpenShift 4: LDAP and LDAPS

[Red Hat](https://yomu.fyi/company/red-hat) · Francisco De Melo Junior · Oct 23, 2026

**Type:** Tutorial

## Summary

This article, part 2 of a series on securing Red Hat Data Grid on OpenShift 4, explains direct LDAP and LDAPS authentication against directory services using the Data Grid operator. The operator references a ConfigMap via spec.configMapName on the Infinispan custom resource to define LDAP server URLs, principal credentials, search DNs, and user role mappings. For LDAPS, the operator imports the directory server certificate into the pod truststore via a secret referenced by spec.security.endpointEncryption.clientCertSecretName, with clientCert set to None, Validate, or Authenticate to control mutual TLS. A test setup deploys OpenLDAP using a Helm chart and configures the security realm; the example uses hardcoded plaintext credentials, but production deployments should use encrypted keystores or OpenShift secrets. The author recommends LDAPS for production to encrypt credentials in transit and positions direct LDAP as a lean alternative to deploying a centralized SSO identity provider like Keycloak.

## Context

This post is the second in a series on securing Red Hat Data Grid on OpenShift 4. The first part covered centralized SSO with Keycloak.

## Approach / What changed

Deploy the Data Grid operator and create an Infinispan custom resource that references a ConfigMap containing LDAP realm settings, including server URL, principal credentials, search DN, and attribute mappings. For LDAPS, obtain the LDAP server certificate, store it in an OpenShift secret, and reference it via spec.security.endpointEncryption.clientCertSecretName with the desired clientCert verification strategy. A test setup uses a Helm chart to deploy OpenLDAP.

## Takeaways

- Direct LDAP integration uses spec.configMapName on the Infinispan custom resource to define LDAP connection properties and security realms, including server URL, credentials, search DN, and attribute-based role mappings.
- For LDAPS, the operator imports the LDAP server certificate into the pod truststore via a secret referenced by clientCertSecretName, with clientCert options None, Validate, or Authenticate to control mutual TLS.
- The post recommends LDAPS for production to encrypt credentials in transit and notes that direct LDAP avoids the operational overhead of a full SSO provider like Keycloak.

## FAQ

### How do I configure LDAP realm settings in Data Grid on OpenShift?

In the Infinispan custom resource, reference a ConfigMap in spec.configMapName that contains your LDAP server URL, principal credentials, search DN, and user role mappings. The example shows an ldap-realm with identity-mapping, attribute-mapping, and user-password-mapper.

### What is the difference between LDAP and LDAPS for Data Grid on OpenShift?

LDAP uses unencrypted traffic, suitable for internal dev/test. LDAPS encrypts traffic using TLS and requires importing the LDAP server certificate into the pod truststore via a secret referenced by clientCertSecretName.

### How do I set up mutual TLS for LDAP in Data Grid?

Set clientCert to Validate or Authenticate in the Infinispan custom resource's spec.security.endpointEncryption and reference the certificate secret via clientCertSecretName. This enforces client certificate authentication for incoming connections.

**Tags:** [Authentication](https://yomu.fyi/topic/authentication), [LDAP](https://yomu.fyi/topic/ldap), [Red Hat OpenShift](https://yomu.fyi/topic/red-hat-openshift), [TLS](https://yomu.fyi/topic/tls)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/10/23/advanced-authentication-data-grid-red-hat-openshift-4-ldap-and-ldaps)
- Source URL: https://developers.redhat.com/articles/2026/10/23/advanced-authentication-data-grid-red-hat-openshift-4-ldap-and-ldaps
- Ingested by Yomu: 2026-10-23T15:00:19.060Z

[Read original post](https://developers.redhat.com/articles/2026/10/23/advanced-authentication-data-grid-red-hat-openshift-4-ldap-and-ldaps)
