Skip to content

LDAP Authentication Setup

LDAP Authentication integrates RAMP with enterprise directories like Active Directory or OpenLDAP. Users authenticate using their directory credentials, and RAMP can search the directory for users and groups.

  • Authenticate against LDAP/Active Directory
  • Auto-provision users on first login
  • Directory search for users and groups
  • Support for SSL/TLS (LDAPS)
  • Works on Windows, Linux, and Docker
  • Enterprise directory integration
  • Centralized user management
  • Active Directory without Windows Auth/IIS
  • OpenLDAP environments
  • LDAP server (Active Directory or OpenLDAP)
  • LDAP server hostname/IP and port (389 for LDAP, 636 for LDAPS)
  • Service account for LDAP bind operations
  • Network access from RAMP to LDAP server

You’ll need the following information from your LDAP administrator:

SettingExample (Active Directory)Example (OpenLDAP)
LDAP Serverldap://dc.contoso.com:389ldap://ldap.company.com:389
Search BaseDC=contoso,DC=comdc=company,dc=com
Service Account DNCN=ramp-service,OU=Service Accounts,DC=contoso,DC=comcn=ramp-bind,ou=services,dc=company,dc=com
Service Account Password(from AD admin)(from LDAP admin)
User Filter(&(objectClass=user)(objectCategory=person))(objectClass=inetOrgPerson)
Group Filter(objectClass=group)(objectClass=groupOfNames)

Edit appsettings.json:

{
"Authentication": {
"Providers": {
"LDAP": {
"Enabled": true,
"Server": "ldap://dc.contoso.com:389",
"SearchBase": "DC=contoso,DC=com",
"BindDn": "CN=ramp-service,OU=Service Accounts,DC=contoso,DC=com",
"BindPassword": "ServiceAccountPassword123!",
"UseSsl": false,
"UserSearchFilter": "(&(objectClass=user)(objectCategory=person)(sAMAccountName={0}))",
"GroupSearchFilter": "(objectClass=group)",
"AttributeMappings": {
"Username": "sAMAccountName",
"Email": "mail",
"FirstName": "givenName",
"LastName": "sn",
"DisplayName": "displayName"
},
"EnableDirectorySearch": true,
"AutoProvisionUsers": true
}
}
},
"Bootstrap": {
"Administrators": [
{
"IdentityProvider": "LDAP",
"Username": "admin",
"Email": "admin@contoso.com"
}
]
}
}
SettingRequiredDescription
EnabledYesSet to true to enable LDAP authentication
ServerYesLDAP server URL (format: ldap://host:port or ldaps://host:port)
SearchBaseYesBase DN for all LDAP searches
BindDnYesDistinguished Name of service account for bind operations
BindPasswordYesPassword for service account
UseSslNoUse LDAPS (port 636). Default: false
UserSearchFilterYesLDAP filter to find users. {0} is replaced with username
GroupSearchFilterNoLDAP filter to find groups
AttributeMappingsYesMap LDAP attributes to RAMP user fields
EnableDirectorySearchNoAllow searching directory for users/groups. Default: false
AutoProvisionUsersNoCreate RAMP user on first login. Default: true

{
"Authentication": {
"Providers": {
"LDAP": {
"Enabled": true,
"Server": "ldap://dc.contoso.com:389",
"SearchBase": "DC=contoso,DC=com",
"BindDn": "CN=ramp-service,OU=Service Accounts,DC=contoso,DC=com",
"BindPassword": "ServiceAccountPassword123!",
"UseSsl": false,
"UserSearchFilter": "(&(objectClass=user)(objectCategory=person)(sAMAccountName={0}))",
"GroupSearchFilter": "(objectClass=group)",
"AttributeMappings": {
"Username": "sAMAccountName",
"Email": "mail",
"FirstName": "givenName",
"LastName": "sn",
"DisplayName": "displayName"
},
"EnableDirectorySearch": true,
"AutoProvisionUsers": true
}
}
}
}

Service Account Permissions (Active Directory)

Section titled “Service Account Permissions (Active Directory)”

The service account needs:

  • Read permissions on all user objects
  • Read permissions on all group objects
  • No special elevated permissions required

Create service account:

Terminal window
# Create service account in Active Directory
New-ADUser -Name "ramp-service" `
-SamAccountName "ramp-service" `
-UserPrincipalName "ramp-service@contoso.com" `
-Path "OU=Service Accounts,DC=contoso,DC=com" `
-AccountPassword (ConvertTo-SecureString "ServicePassword123!" -AsPlainText -Force) `
-Enabled $true `
-PasswordNeverExpires $true `
-CannotChangePassword $true

Section titled “Step 4: Enable SSL/TLS (LDAPS) — Recommended”

For production, use LDAPS (LDAP over SSL/TLS) on port 636.

{
"Authentication": {
"Providers": {
"LDAP": {
"Server": "ldaps://dc.contoso.com:636",
"UseSsl": true,
"SearchBase": "DC=contoso,DC=com",
"BindDn": "CN=ramp-service,OU=Service Accounts,DC=contoso,DC=com",
"BindPassword": "ServiceAccountPassword123!"
}
}
}
}
  • LDAP server must have valid SSL certificate
  • Certificate must be trusted by RAMP server
  • For self-signed certificates, add to trusted root certificate store
Terminal window
# Copy certificate to trusted certificates
sudo cp ldap-ca.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates

Add LDAP admin to bootstrap configuration:

{
"Bootstrap": {
"Administrators": [
{
"IdentityProvider": "LDAP",
"Username": "john.doe",
"Email": "john.doe@contoso.com"
}
]
}
}

Terminal window
cd src/RAMP.API
dotnet run

Look for LDAP initialization messages:

[INFO] LDAP provider initialized: ldap://dc.contoso.com:389
[INFO] LDAP bind successful
  1. Navigate to RAMP login page
  2. Enter LDAP username (e.g., john.doe for AD, jdoe for OpenLDAP)
  3. Enter LDAP password
  4. If auto-provision is enabled, user account is created automatically

When EnableDirectorySearch is true, administrators can search the LDAP directory when assigning roles.

  1. Admin navigates to assign roles (Template Roles, Instance Roles, etc.)
  2. Click “Add User”
  3. Type username or email
  4. RAMP queries LDAP and shows matching users
  5. Select user from dropdown
  6. User is auto-provisioned if they haven’t logged in yet
  • Searches are cached for 5 minutes
  • Maximum 50 results per search
  • Searches both username and email fields

When AutoProvisionUsers is true:

  1. User enters LDAP credentials
  2. RAMP validates credentials against LDAP
  3. On successful bind, RAMP creates user record with:
    • Username from LDAP attribute
    • Email from LDAP attribute
    • First/Last name from LDAP attributes
    • IdentityProvider: LDAP
  4. User can now log in to RAMP

Check 1: Verify network connectivity

Terminal window
# Test LDAP port is accessible
telnet dc.contoso.com 389
# Or with nc
nc -zv dc.contoso.com 389

Check 2: Verify DNS resolution

Terminal window
nslookup dc.contoso.com

Check 3: Check firewall rules

  • Ensure RAMP server can reach LDAP port (389 or 636)
  • Check both host firewall and network firewalls

Check 1: Verify BindDn format

  • Active Directory: CN=username,OU=unit,DC=domain,DC=com
  • OpenLDAP: cn=username,ou=unit,dc=domain,dc=com

Check 2: Test bind manually

Terminal window
# Active Directory
ldapsearch -H ldap://dc.contoso.com -D "CN=ramp-service,OU=Service Accounts,DC=contoso,DC=com" -W -b "DC=contoso,DC=com" "(sAMAccountName=testuser)"
# OpenLDAP
ldapsearch -H ldap://ldap.company.com -D "cn=ramp-bind,ou=services,dc=company,dc=com" -W -b "dc=company,dc=com" "(uid=testuser)"

Check 3: Verify password

  • Ensure no special characters are improperly escaped
  • Test with simple password first

Check 1: Verify user exists in LDAP

Terminal window
ldapsearch -H ldap://dc.contoso.com -D "..." -W -b "DC=contoso,DC=com" "(sAMAccountName=username)"

Check 2: Verify UserSearchFilter

  • Ensure filter syntax is correct
  • {0} placeholder is replaced with username
  • Test filter manually with ldapsearch

Check 3: Check account status

  • Ensure user account is not disabled in LDAP
  • Verify password hasn’t expired

Check 1: Verify certificate chain

Terminal window
openssl s_client -connect dc.contoso.com:636 -showcerts

Check 2: Check certificate trust

  • Ensure CA certificate is in trusted store
  • For self-signed certs, import the certificate

Check 3: Disable SSL verification (testing only)

{
"Authentication": {
"Providers": {
"LDAP": {
"UseSsl": true,
"IgnoreSslErrors": true
}
}
}
}

Always use SSL/TLS (port 636) for production deployments to encrypt credentials in transit.

  • Service account should have read-only permissions
  • No admin or write permissions needed
  • Restrict to specific OUs if possible

Store BindPassword in Azure Key Vault or User Secrets, not in appsettings.json:

Terminal window
# Development
dotnet user-secrets set "Authentication:Providers:LDAP:BindPassword" "password"
# Production - Azure Key Vault
# Store as: Authentication--Providers--LDAP--BindPassword
  • Enable audit logging
  • Set up alerts for repeated bind failures
  • May indicate brute force or misconfiguration
  • Restrict LDAP access to RAMP server IPs only
  • Use firewall rules to block unauthorized access
  • Consider using VPN for external access

Map additional LDAP attributes:

{
"AttributeMappings": {
"Username": "sAMAccountName",
"Email": "mail",
"FirstName": "givenName",
"LastName": "sn",
"DisplayName": "displayName",
"EmployeeId": "employeeNumber",
"Department": "department",
"Title": "title"
}
}

To restrict RAMP access to specific AD groups, use a filter that includes memberOf:

{
"UserSearchFilter": "(&(objectClass=user)(memberOf=CN=RAMP Users,OU=Groups,DC=contoso,DC=com)(sAMAccountName={0}))"
}