How to setup LDAP integration in a Niagara Station
LDAP (Lightweight Directory Access Protocol) integration allows Niagara 4 Stations to authenticate users against centralised directory services such as Active Directory, OpenLDAP, or other LDAP-compliant directories. This enables single sign-on capabilities and centralised user management.
Overview
LDAP integration provides:
- Centralised Authentication: Users authenticate against central directory
- Single Sign-On: Users can access multiple systems with one login
- User Management: Centralised user account management
- Group-Based Access: Leverage LDAP groups for access control
- Reduced Administration: Less user management overhead
Prerequisites
Before configuring LDAP integration, ensure you have:
- Administrative access to the Niagara Station
- LDAP server details (hostname, port, base DN)
- LDAP service account credentials (for binding)
- Network connectivity to LDAP server
- Understanding of your organisation's LDAP structure
Understanding LDAP Integration
How It Works
- User Login: User attempts to log into Niagara Station
- LDAP Query: Station queries LDAP server for user credentials
- Authentication: LDAP server verifies user credentials
- User Mapping: Station maps LDAP user to Station user account
- Access Grant: Station grants access based on mapped permissions
LDAP Components
- LDAP Server: Directory server (e.g., Active Directory, OpenLDAP)
- Base DN: Base distinguished name for searches
- Bind DN: Service account for LDAP queries
- User DN: Distinguished name pattern for users
- Group DN: Distinguished name pattern for groups
Step-by-Step Configuration
Step 1: Gather LDAP Server Information
Collect the following information:
- LDAP Server Host: Hostname or IP address
- LDAP Port: Typically 389 (LDAP) or 636 (LDAPS)
- Base DN: Base distinguished name (e.g.,
dc=example,dc=com) - Bind DN: Service account DN (e.g.,
cn=niagara,ou=services,dc=example,dc=com) - Bind Password: Service account password
- User Search Base: Base DN for user searches
- User Search Filter: LDAP filter for finding users (e.g.,
(sAMAccountName={0})) - Group Search Base: Base DN for group searches
- Group Search Filter: LDAP filter for finding groups
Step 2: Access LDAP Service Configuration
- Open Niagara Workbench
- Connect to your target Station
- Navigate to Services in the Station tree
- Locate or create the LDAP Service
If the service doesn't exist:
- Right-click on Services
- Select New → Service → LDAP Service
- Enter a name (e.g., "LDAP Authentication Service")
- Click OK
Step 3: Configure LDAP Server Connection
- Right-click on the LDAP Service
- Select Properties
- Navigate to Connection or Server tab
Configure server settings:
- LDAP Server: Enter LDAP server hostname or IP
- Port: Enter LDAP port (389 for LDAP, 636 for LDAPS)
- Use SSL/TLS: Enable for secure connections (LDAPS)
- Connection Timeout: Set timeout value (typically 30 seconds)
- Base DN: Enter base distinguished name
Step 4: Configure Authentication
Navigate to Authentication tab:
- Bind DN: Enter service account distinguished name
- Bind Password: Enter service account password
- Authentication Method: Select authentication method (Simple, SASL, etc.)
Step 5: Configure User Search
Navigate to User Search section:
- User Search Base: Base DN for user searches (e.g.,
ou=users,dc=example,dc=com) - User Search Filter: LDAP filter for users
- Active Directory:
(sAMAccountName={0}) - OpenLDAP:
(uid={0}) - Custom: Configure based on your LDAP schema
- Active Directory:
- User DN Pattern: Pattern for user distinguished names
- Username Attribute: Attribute containing username (e.g.,
sAMAccountName,uid)
Step 6: Configure Group Search (Optional)
If using LDAP groups for access control:
-
Navigate to Group Search section
-
Configure group settings:
- Group Search Base: Base DN for group searches
- Group Search Filter: LDAP filter for groups
- Group Membership Attribute: Attribute indicating group membership
- Group Name Attribute: Attribute containing group name
Step 7: Configure User Mapping
Set up how LDAP users map to Station users:
- Auto-Create Users: Automatically create Station users for LDAP users
- User Template: Template for creating new users
- Default Roles: Default roles assigned to LDAP users
- Group Mapping: Map LDAP groups to Station roles
Step 8: Test LDAP Connection
- In LDAP Service properties, locate Test Connection button
- Click Test Connection
- Review test results:
- Connection Test: Verifies server connectivity
- Bind Test: Verifies authentication credentials
- User Search Test: Tests user search functionality
- Group Search Test: Tests group search functionality
Step 9: Enable LDAP Service
- Ensure Enabled checkbox is selected
- Click OK to save configuration
- Service will start automatically
Step 10: Configure Station Authentication
- Navigate to Station → Properties
- Go to Security or Authentication tab
- Enable LDAP Authentication
- Select the configured LDAP Service
- Configure authentication order (LDAP first, then local, or vice versa)
Step 11: Test User Authentication
- Logout: Log out of current session
- Login Test: Attempt to log in with LDAP credentials
- Verify Access: Verify user has appropriate access
- Check Mapping: Verify user mapping and roles
Configuration Examples
Active Directory Configuration
LDAP Server: ad.example.com
Port: 389 (or 636 for LDAPS)
Base DN: dc=example,dc=com
Bind DN: cn=niagara,ou=services,dc=example,dc=com
User Search Base: ou=users,dc=example,dc=com
User Search Filter: (sAMAccountName={0})
Username Attribute: sAMAccountName
Group Search Base: ou=groups,dc=example,dc=com
Group Search Filter: (member={0})
OpenLDAP Configuration
LDAP Server: ldap.example.com
Port: 389 (or 636 for LDAPS)
Base DN: dc=example,dc=com
Bind DN: cn=niagara,ou=services,dc=example,dc=com
User Search Base: ou=people,dc=example,dc=com
User Search Filter: (uid={0})
Username Attribute: uid
Group Search Base: ou=groups,dc=example,dc=com
Group Search Filter: (memberUid={0})
Troubleshooting
Connection Failures
If unable to connect to LDAP server:
- Network Connectivity: Verify network connectivity to LDAP server
- Firewall Rules: Ensure LDAP ports are not blocked
- Server Address: Verify LDAP server hostname/IP is correct
- Port Configuration: Verify port number is correct (389/636)
- SSL/TLS: Check SSL/TLS configuration matches server requirements
Authentication Failures
If authentication fails:
- Bind Credentials: Verify Bind DN and password are correct
- Service Account: Ensure service account has necessary permissions
- User Search Filter: Verify user search filter matches LDAP schema
- User DN: Check user distinguished name format
- LDAP Logs: Review LDAP service logs for detailed error messages
User Not Found
If users cannot be found:
- Search Base: Verify user search base DN is correct
- Search Filter: Check search filter syntax and attributes
- User Location: Verify users exist in specified search base
- Permissions: Ensure service account can search user locations
- Test Search: Use LDAP browser to test search manually
Group Mapping Issues
If group mapping doesn't work:
- Group Search: Verify group search base and filter
- Membership Attribute: Check group membership attribute name
- Group Structure: Verify LDAP group structure matches configuration
- Permissions: Ensure service account can read group information
- Mapping Configuration: Review group-to-role mapping settings
Security Best Practices
Connection Security
- Use LDAPS: Always use LDAPS (port 636) or TLS for production
- Certificate Validation: Enable certificate validation for LDAPS
- Network Security: Use VPN or secure network for LDAP connections
- Firewall Rules: Restrict LDAP access to authorised networks
Credential Management
- Service Account: Use dedicated service account with minimal permissions
- Password Security: Store service account password securely
- Regular Rotation: Periodically rotate service account passwords
- Access Control: Limit access to LDAP service configuration
User Management
- Principle of Least Privilege: Grant users minimum necessary permissions
- Group-Based Access: Use LDAP groups for access control
- Regular Audits: Periodically audit user access and permissions
- Account Management: Coordinate with LDAP administrators for account changes
Advanced Configuration
Multiple LDAP Servers
Configure failover for high availability:
- Primary Server: Configure primary LDAP server
- Secondary Server: Configure secondary LDAP server
- Failover: Enable automatic failover
- Load Balancing: Configure load balancing if supported
Custom Attribute Mapping
Map custom LDAP attributes:
- Attribute Mapping: Configure custom attribute mappings
- User Properties: Map LDAP attributes to Station user properties
- Group Attributes: Map group attributes for access control
- Custom Filters: Create custom search filters for specific requirements
Integration with Other Services
LDAP can integrate with:
- Two-Factor Authentication: Combine LDAP with 2FA
- Email Service: Use LDAP email attributes
- Single Sign-On: Integrate with SSO solutions
- Custom Applications: Extend with custom authentication modules
Related Topics
- How to set two-factor authentication in a Niagara Station (Gauth)
- What to do when a Platform login is failing
Additional Resources
- LDAP Protocol Specification (RFC 4511)
- Active Directory Integration Guide
- OpenLDAP Administration Guide
- Niagara 4 Security Best Practices