Blog
nifildapsecurityauthentication

Apache NiFi LDAP Authentication Setup Guide (Including Cloudera CFM)

Step-by-step guide to configuring LDAP authentication in NiFi, covering login-identity-providers.xml, authorizers.xml, and Cloudera Manager settings.

Data DynamicsApril 13, 202612 min read

Apache NiFi runs without user authentication by default, but in production environments, authentication must be enabled. One of the most widely used approaches is LDAP (Lightweight Directory Access Protocol) authentication. This post explains NiFi LDAP authentication configuration for both open-source NiFi and Cloudera CFM (Cloudera Flow Management) environments. It references the Cloudera CFM LDAP Authentication documentation and the Apache NiFi Administration Guide.

1. Prerequisites

The following conditions must be met before configuring LDAP authentication.

ItemDescription
TLS/SSL enabledHTTPS must be enabled on NiFi to support authentication
LDAP serverAn accessible LDAP server such as OpenLDAP, Active Directory, or 389 Directory Server
Service accountManager DN and password for searching users on the LDAP server
CertificatesTruststore containing the LDAP server's CA certificate when using LDAPS or START_TLS

Note: NiFi cannot enable authentication without HTTPS. You must configure TLS/SSL before setting up LDAP.

2. How LDAP Authentication Works

NiFi's LDAP authentication consists of two components.

User → NiFi Login Screen → Login Identity Provider (Authentication)
                                    ↓
                              Bind to LDAP server to verify user
                                    ↓
                              Authorizer (Authorization) → Check permissions
ComponentConfiguration FileRole
Login Identity Providerlogin-identity-providers.xmlAuthenticates by binding username/password against the LDAP server
Authorizerauthorizers.xmlDetermines which resources an authenticated user can access

3. LDAP Configuration in Open-Source NiFi

3.1 nifi.properties Configuration

First, enable the Login Identity Provider in nifi.properties.

# Enable LDAP Login Identity Provider
nifi.security.user.login.identity.provider=ldap-provider

3.2 login-identity-providers.xml Configuration

Configure the LDAP Provider in conf/login-identity-providers.xml. This file is the core of NiFi's LDAP authentication setup.

<loginIdentityProviders>
    <provider>
        <identifier>ldap-provider</identifier>
        <class>org.apache.nifi.ldap.LdapProvider</class>
        <property name="Authentication Strategy">START_TLS</property>
 
        <property name="Manager DN">uid=admin,ou=people,dc=example,dc=com</property>
        <property name="Manager Password">admin-password</property>
 
        <property name="Referral Strategy">FOLLOW</property>
        <property name="Connect Timeout">10 secs</property>
        <property name="Read Timeout">10 secs</property>
 
        <property name="Url">ldap://ldap.example.com:389</property>
        <property name="User Search Base">ou=people,dc=example,dc=com</property>
        <property name="User Search Filter">uid={0}</property>
 
        <property name="Identity Strategy">USE_USERNAME</property>
        <property name="Authentication Expiration">12 hours</property>
 
        <!-- TLS settings (required for START_TLS or LDAPS) -->
        <property name="TLS - Keystore">/opt/nifi/conf/keystore.jks</property>
        <property name="TLS - Keystore Password">keystore-password</property>
        <property name="TLS - Keystore Type">JKS</property>
        <property name="TLS - Truststore">/opt/nifi/conf/truststore.jks</property>
        <property name="TLS - Truststore Password">truststore-password</property>
        <property name="TLS - Truststore Type">JKS</property>
        <property name="TLS - Client Auth">NONE</property>
        <property name="TLS - Protocol">TLSv1.2</property>
        <property name="TLS - Shutdown Gracefully">false</property>
    </provider>
</loginIdentityProviders>

3.3 Key Properties Explained

Authentication Strategy

StrategyDescriptionLDAP URL Example
ANONYMOUSConnect to LDAP without authentication. For testing onlyldap://ldap.example.com:389
SIMPLEBind with Manager DN/Password in plaintext. Should be used with LDAPSldap://ldap.example.com:389
LDAPSSSL-encrypted connection (port 636). Secure from the startldaps://ldap.example.com:636
START_TLSPlaintext connection upgraded to TLS (port 389)ldap://ldap.example.com:389

Production recommendation: Use LDAPS or START_TLS. SIMPLE transmits passwords in plaintext over the network.

Identity Strategy

StrategyDescriptionExample
USE_DNUses the full DN from LDAP search result as NiFi user IDuid=john,ou=people,dc=example,dc=com
USE_USERNAMEUses the login username as-is for NiFi user IDjohn

Recommendation: USE_USERNAME displays cleaner usernames in the NiFi UI and simplifies authorizers.xml configuration for Initial Admin Identity.

Referral Strategy

StrategyDescription
FOLLOWAutomatically follow LDAP referrals (recommended for Active Directory)
IGNOREIgnore LDAP referrals
THROWThrow an exception when LDAP referrals occur

User Search Filter

{0} is replaced with the login ID entered by the user.

LDAP ServerCommon FilterDescription
OpenLDAPuid={0}Search by uid attribute
Active DirectorysAMAccountName={0}Search by SAM account name
Active Directory (UPN)userPrincipalName={0}Search by UPN

3.4 authorizers.xml Configuration

After authentication, configure authorizers.xml for authorization. The Initial Admin Identity designates the first administrator among LDAP-authenticated users.

<authorizers>
    <userGroupProvider>
        <identifier>file-user-group-provider</identifier>
        <class>org.apache.nifi.authorization.FileUserGroupProvider</class>
        <property name="Users File">./conf/users.xml</property>
        <property name="Initial User Identity 1">admin</property>
    </userGroupProvider>
 
    <accessPolicyProvider>
        <identifier>file-access-policy-provider</identifier>
        <class>org.apache.nifi.authorization.FileAccessPolicyProvider</class>
        <property name="User Group Provider">file-user-group-provider</property>
        <property name="Authorizations File">./conf/authorizations.xml</property>
        <property name="Initial Admin Identity">admin</property>
        <property name="Node Identity 1">CN=nifi-node1.example.com, OU=NiFi</property>
    </accessPolicyProvider>
 
    <authorizer>
        <identifier>managed-authorizer</identifier>
        <class>org.apache.nifi.authorization.StandardManagedAuthorizer</class>
        <property name="Access Policy Provider">file-access-policy-provider</property>
    </authorizer>
</authorizers>

Important: The Initial Admin Identity value must match the Identity Strategy in login-identity-providers.xml. With USE_USERNAME it should be admin; with USE_DN it should be uid=admin,ou=people,dc=example,dc=com.

3.5 LDAP User Group Provider (Optional)

To automatically sync users and groups from the LDAP server, configure the LdapUserGroupProvider.

<userGroupProvider>
    <identifier>ldap-user-group-provider</identifier>
    <class>org.apache.nifi.ldap.tenants.LdapUserGroupProvider</class>
    <property name="Authentication Strategy">START_TLS</property>
 
    <property name="Manager DN">uid=admin,ou=people,dc=example,dc=com</property>
    <property name="Manager Password">admin-password</property>
 
    <property name="Url">ldap://ldap.example.com:389</property>
 
    <property name="User Search Base">ou=people,dc=example,dc=com</property>
    <property name="User Object Class">person</property>
    <property name="User Search Scope">ONE_LEVEL</property>
    <property name="User Search Filter">(objectClass=person)</property>
    <property name="User Identity Attribute">uid</property>
 
    <property name="Group Search Base">ou=groups,dc=example,dc=com</property>
    <property name="Group Object Class">groupOfNames</property>
    <property name="Group Search Scope">ONE_LEVEL</property>
    <property name="Group Search Filter">(objectClass=groupOfNames)</property>
    <property name="Group Name Attribute">cn</property>
    <property name="Group Member Attribute">member</property>
    <property name="Group Member Attribute - Referenced Member Identity">dn</property>
 
    <property name="Sync Interval">30 mins</property>
    <property name="Page Size">500</property>
    <property name="Group Membership - Enforce Case Sensitivity">false</property>
 
    <!-- TLS settings (for START_TLS or LDAPS) -->
    <property name="TLS - Keystore">/opt/nifi/conf/keystore.jks</property>
    <property name="TLS - Keystore Password">keystore-password</property>
    <property name="TLS - Keystore Type">JKS</property>
    <property name="TLS - Truststore">/opt/nifi/conf/truststore.jks</property>
    <property name="TLS - Truststore Password">truststore-password</property>
    <property name="TLS - Truststore Type">JKS</property>
    <property name="TLS - Client Auth">NONE</property>
    <property name="TLS - Protocol">TLSv1.2</property>
</userGroupProvider>

Key LdapUserGroupProvider properties:

PropertyDescription
User Search BaseLDAP base DN for user searches
User Object ClassUser object class (e.g., person, inetOrgPerson)
User Identity AttributeLDAP attribute to use as NiFi user ID (e.g., uid, sAMAccountName)
Group Search BaseLDAP base DN for group searches
Group Object ClassGroup object class (e.g., groupOfNames, group)
Group Name AttributeLDAP attribute for group names (e.g., cn)
Group Member AttributeAttribute representing group membership (e.g., member, memberUid)
Sync IntervalHow often to sync users/groups from LDAP (e.g., 30 mins)
Page SizeLDAP search page size (essential for large directories)

4. LDAP Configuration in Cloudera CFM

In environments managed through Cloudera Manager (CM), settings are configured via the CM UI instead of editing XML files directly.

4.1 NiFi LDAP Settings (Cloudera Manager)

Navigate to the NiFi service's Configuration tab in CM and set the following properties.

CM Property NameExample ValueDescription
Enable TLS/SSL for NiFi NodeCheckedEnable HTTPS (required prerequisite)
LDAP EnabledCheckedActivate LDAP authentication
Login Identity Provider: Default LDAP Provider Classorg.apache.nifi.ldap.LdapProviderLDAP Provider class
Login Identity Provider IDldap-providerProvider identifier
Initial Admin IdentityadminInitial administrator user
LDAP Authentication StrategySTART_TLSAuthentication strategy
LDAP Manager DNuid=admin,ou=people,dc=example,dc=comLDAP service account DN
LDAP Manager Password(password)Service account password
LDAP URLldap://ldap.example.com:389LDAP server URL
LDAP User Search Baseou=people,dc=example,dc=comUser search base DN
Login Identity Provider: Default LDAP User Search Filteruid={0}User search filter
Login Identity Provider: Default LDAP Identity StrategyUSE_USERNAMEIdentity strategy

TLS Properties (When Using LDAPS or START_TLS)

CM Property NameExample Value
Login Identity Provider: Default LDAP TLS - Keystore/opt/nifi/conf/keystore.jks
Login Identity Provider: Default LDAP TLS - Keystore Password(password)
Login Identity Provider: Default LDAP TLS - Keystore TypeJKS
Login Identity Provider: Default LDAP TLS - Truststore/opt/nifi/conf/truststore.jks
Login Identity Provider: Default LDAP TLS - Truststore Password(password)
Login Identity Provider: Default LDAP TLS - Truststore TypeJKS
TLS - Client AuthNONE
TLS - ProtocolTLSv1.2
TLS - Shutdown Gracefullyfalse

4.2 NiFi Registry LDAP Settings (Cloudera Manager)

NiFi Registry requires its own LDAP configuration. Properties are nearly identical to NiFi but use a different class name.

CM Property NameValue
Identity Provider: Default LDAP Provider Classorg.apache.nifi.registry.security.ldap.LdapIdentityProvider
Identity Provider Identifierldap-provider

All other settings (LDAP URL, Manager DN, Search Base, TLS) are configured identically to NiFi.

4.3 Resetting Initial Admin Identity

If Initial Admin Identity was configured incorrectly in CM, execute Actions > Reset File-based Authorizer Users and Policies on the service. This regenerates users.xml and authorizations.xml, archiving previous versions.

5. Active Directory Configuration Example

When using Active Directory (AD), certain settings differ from standard OpenLDAP configurations.

5.1 login-identity-providers.xml (Active Directory)

<provider>
    <identifier>ldap-provider</identifier>
    <class>org.apache.nifi.ldap.LdapProvider</class>
    <property name="Authentication Strategy">LDAPS</property>
 
    <property name="Manager DN">CN=svc-nifi,OU=ServiceAccounts,DC=corp,DC=example,DC=com</property>
    <property name="Manager Password">service-account-password</property>
 
    <property name="Referral Strategy">FOLLOW</property>
    <property name="Connect Timeout">10 secs</property>
    <property name="Read Timeout">10 secs</property>
 
    <property name="Url">ldaps://ad.corp.example.com:636</property>
    <property name="User Search Base">OU=Users,DC=corp,DC=example,DC=com</property>
    <property name="User Search Filter">sAMAccountName={0}</property>
 
    <property name="Identity Strategy">USE_USERNAME</property>
    <property name="Authentication Expiration">12 hours</property>
 
    <property name="TLS - Keystore">/opt/nifi/conf/keystore.jks</property>
    <property name="TLS - Keystore Password">keystore-password</property>
    <property name="TLS - Keystore Type">JKS</property>
    <property name="TLS - Truststore">/opt/nifi/conf/truststore.jks</property>
    <property name="TLS - Truststore Password">truststore-password</property>
    <property name="TLS - Truststore Type">JKS</property>
    <property name="TLS - Client Auth">NONE</property>
    <property name="TLS - Protocol">TLSv1.2</property>
    <property name="TLS - Shutdown Gracefully">false</property>
</provider>

Key differences between Active Directory and OpenLDAP:

ItemOpenLDAPActive Directory
User Search Filteruid={0}sAMAccountName={0}
Manager DN Formatuid=admin,ou=people,dc=...CN=svc-nifi,OU=ServiceAccounts,DC=...
Default Port (SSL)636636
Default Port (Plaintext)389389
Referral StrategyIGNORE possibleFOLLOW recommended (cross-domain referrals)
Group Object ClassgroupOfNamesgroup
Member Attributemembermember

6. Cluster Environment Considerations

Additional considerations when configuring LDAP authentication in a NiFi cluster.

6.1 Configuration Consistency Across Nodes

login-identity-providers.xml and authorizers.xml must be identical across all cluster nodes. Inconsistent configurations between nodes cause authentication behavior mismatches and unexpected errors.

6.2 Node Identity Configuration

Each cluster node must be registered as a Node Identity in authorizers.xml.

<property name="Node Identity 1">CN=nifi-node1.example.com, OU=NiFi</property>
<property name="Node Identity 2">CN=nifi-node2.example.com, OU=NiFi</property>
<property name="Node Identity 3">CN=nifi-node3.example.com, OU=NiFi</property>

6.3 LDAP Server Availability

If the LDAP server goes down, users cannot log into NiFi. In production environments, LDAP server redundancy is recommended. You can specify multiple space-separated LDAP URLs in the Url property.

<property name="Url">ldaps://ldap1.example.com:636 ldaps://ldap2.example.com:636</property>

7. Troubleshooting

7.1 Login Failure Checklist

SymptomCauseSolution
Login page not displayedHTTPS not enabledEnable HTTPS in nifi.properties
"Login credentials were not verified"LDAP server connection failureCheck LDAP URL, Manager DN/Password
Login succeeds but no permissionsInitial Admin Identity mismatchCorrect value to match Identity Strategy
"Connect timeout" errorLDAP server network issueCheck firewall, ports (389/636)
"PKIX path building failed"TLS certificate trust issueAdd LDAP server's CA certificate to truststore
Referral-related errorsAD referrals not handledChange Referral Strategy to FOLLOW

7.2 Log Inspection

# Check LDAP-related messages in NiFi logs
grep -i "ldap\|login\|identity\|auth" /opt/nifi/logs/nifi-app.log | tail -50
 
# Check certificate-related errors
grep -i "ssl\|tls\|certificate\|pkix" /opt/nifi/logs/nifi-app.log | tail -30

7.3 LDAP Connection Testing

Test LDAP connectivity before restarting NiFi.

# Test connection with ldapsearch (OpenLDAP)
ldapsearch -x -H ldap://ldap.example.com:389 \
    -D "uid=admin,ou=people,dc=example,dc=com" \
    -w admin-password \
    -b "ou=people,dc=example,dc=com" \
    "uid=testuser"
 
# Test connection with ldapsearch (Active Directory, LDAPS)
ldapsearch -x -H ldaps://ad.corp.example.com:636 \
    -D "CN=svc-nifi,OU=ServiceAccounts,DC=corp,DC=example,DC=com" \
    -w service-account-password \
    -b "OU=Users,DC=corp,DC=example,DC=com" \
    "sAMAccountName=testuser"

8. Configuration Checklist

StepCheck Item
1Is HTTPS (TLS/SSL) enabled on NiFi?
2Is the LDAP server accessible over the network? (port 389 or 636)
3Can you bind to the LDAP server with the Manager DN? (test with ldapsearch)
4Can users be found with the User Search Filter?
5Is the LdapProvider correctly configured in login-identity-providers.xml?
6Is nifi.security.user.login.identity.provider=ldap-provider set in nifi.properties?
7Does Initial Admin Identity in authorizers.xml match the Identity Strategy?
8When using LDAPS/START_TLS, does the truststore contain the LDAP server's CA certificate?
9In a cluster environment, are configuration files identical across all nodes?
10After restarting NiFi, are there no LDAP-related errors in the logs?

9. Summary

ItemDetails
Required prerequisiteHTTPS enabled
Core configuration fileslogin-identity-providers.xml, authorizers.xml, nifi.properties
Recommended Authentication StrategyLDAPS or START_TLS
Recommended Identity StrategyUSE_USERNAME (cleaner user IDs)
AD User Search FiltersAMAccountName={0}
OpenLDAP User Search Filteruid={0}
LDAP server redundancySpecify multiple space-separated URLs in the Url property
Cluster environmentConfiguration files must be identical across all nodes
CM environment (Cloudera)Configure via CM UI, no direct XML editing needed
Reset Initial Admin IdentityCM > Actions > Reset File-based Authorizer

LDAP authentication is the most fundamental step in NiFi security. The configuration itself isn't complex, but errors frequently occur from Identity Strategy and Initial Admin Identity mismatches, or TLS certificate issues. Test LDAP connectivity with ldapsearch before making changes, and always check NiFi logs after configuration.


If you need assistance with NiFi LDAP authentication setup, feel free to reach out.

— Data Dynamics Engineering Team