🔗Active Directory Integration

Quick Start Guide for Single Sign-On

⚡ 5-Minute Setup

1Install Dependencies

docker exec napsa-backend pip install ldap3

2Configure Environment

Edit /var/NAPSA-ERM/backend/.env:

AD_ENABLED=true
AUTH_MODE=hybrid
AD_SERVER_URL=ldap://your-dc.napsa.co.zm:389
AD_DOMAIN=NAPSA.CO.ZM
AD_BASE_DN=DC=napsa,DC=co,DC=zm
AD_BIND_USER=svc_erm_ldap
AD_BIND_PASSWORD=YourServiceAccountPassword
AD_USER_SEARCH_BASE=OU=Employees,DC=napsa,DC=co,DC=zm

3Restart Backend

docker restart napsa-backend

4Test Connection

python3 /var/NAPSA-ERM/test_ad_integration.py
✓ Success! Your Active Directory integration is now configured. Users can login with their AD credentials.

🔑 Key API Endpoints

Endpoint Purpose
GET /api/v1/ad/status Check if AD is enabled
POST /api/v1/ad/test-connection Test AD connection
POST /api/v1/ad/sync-users Import all AD users
GET /api/v1/ad/search-users?query=name Search AD users
POST /api/v1/ad/import-user?username=XXX Import specific user

📋 Authentication Modes

local - Only database authentication
ad - Only Active Directory authentication
hybrid - Both AD and local (recommended)

🛡️ AD Groups → Roles Mapping

Default group-to-role mapping:

ERM_Adminsadmin
Risk_Managersrisk_manager
Risk_Ownersrisk_owner
Auditorsauditor
ERM_Usersviewer

📖 Additional Resources

Complete Documentation:
For detailed troubleshooting, advanced configuration, and security best practices, refer to the comprehensive guide at:

/var/NAPSA-ERM/AD_INTEGRATION_GUIDE.md
Need Help?
Contact your system administrator or NAPSA IT support team for assistance with Active Directory configuration.