- Technology stack
- Architecture of the Solution
- Installing and Configuring MULTIDIRECTORY
- Configuring Kerberos in the MULTIDIRECTORY Web Interface
- Configuring DNS in the MULTIDIRECTORY Web Interface
- DHCP Configuration
- Domain Trust Configuration
- Group Policy
- Connecting MULTIFACTOR Self-Service Portal to MULTIDIRECTORY
- User, Group, and Resource Management
- Connecting to MULTIFACTOR
- Access Policies
- LDAP Schema
- LDAP Logging Configuration
- Password Policies
- Role and Permission Configuration
- LDAP Authentication in Ansible AWX
- LDAP Authentication in ArgoCD
- LDAP Authentication in GitLab
- LDAP Authentication in GitFlic
- LDAP Authentication in Jenkins
- LDAP Authentication in Harbor
- LDAP Authentication in Nexus
- LDAP Authentication in PostgreSQL
- LDAP Authentication in Rancher
- LDAP Authentication in Proxmox VE
- LDAP Authentication in SpaceVM
- LDAP Authentication in Tantor
- LDAP Authentication in Shturval
- LDAP Authentication in zVirt
- LDAP Authentication in GLPI
Connecting MULTIFACTOR Self-Service Portal to MULTIDIRECTORY
The MULTIFACTOR Self-Service Portal (SSP) is a web-based user self-service platform for LDAP users and a Single Sign-On (SSO) gateway for corporate applications using SAML, OpenID Connect, and OAuth protocols.
The portal is open-source, distributed under the MIT license, and available on GitHub: Source code & build:MultiFactor.SelfService.Linux.Portal.zip
Before You Begin
- Log in to your MULTIFACTOR Customer Portal.
- Go to Resources . Create a new resource of type «Website» — «Self-Service Portal»:
— Name & URL: Any value
— Register new users: Yes
— If 2FA is not configured: Enable self-enrollment - After creation, note the ApiKey and ApiSecret you’ll need during portal configuration.
System Requirements
- OS: Linux (tested on Debian 11)
- Outbound connectivity:
— To api.multifactor.ru:443 (HTTPS)
— To your directory server: LDAP (389) or LDAPS (636)
Architecture Overview
The portal runs as a .NET 6 web application using the built-in Kestrel server (no separate installation required).
- The application runs on the Kestrel web server, which by default listens for HTTP requests on localhost port 5000.
- A reverse proxy (e.g., Nginx or Apache) is configured on the Linux host to accept external HTTPS traffic on standard ports (443/80) and forward it to http://localhost:5000.
- Kestrel receives these proxied requests and passes them to the application for processing.
As a result, the portal application is exclusively accessible through the reverse proxy—it does not accept direct external connections.
Linux Version Limitations
- Cyrillic characters in passwords are not supported
- Authentication against multiple Active Directory domains with trust relationships is not supported
Installation
Tip:
You can use the automated installer to streamline deployment. The installer minimizes manual configuration and includes built-in support for
Let’s EncryptandCertbotto automatically generate and install SSL certificates.Debian 11
- Download the Installer Script
$ sudo mkdir -p /opt/temp/ssp-installer && sudo chmod a+w /opt/temp/ssp-installer $ wget -q -O /opt/temp/ssp-installer/install.sh https://raw.githubusercontent.com/MultifactorLab/Install/main/src/ssp/install.sh $ sudo chmod +x /opt/temp/ssp-installer/install.sh
- Run the Installer
$ /opt/temp/ssp-installer/install.shThe installation log is saved to: /opt/temp/ssp-installer/install-log.txt.
- Edit the configuration file: appsettings.production.xml:
$ sudo vi /opt/multifactor/ssp/app/appsettings.production.xmlRefer to the «Portal Parameters» section for a full description of settings. ВAfter making changes, save and exit by pressing Esc, then typing:
:qw.
- Restart the Portal Service
$ sudo systemctl restart ssp.service
Runtime Dependencies
The portal relies on the ASP.NET Core Runtime 6.0, which is:
Free and open-source,developed by Microsoft in collaboration with the open-source community, distributed under permissive licenses that impose no usage restrictions.
This runtime provides all necessary libraries to run the Self-Service Portal on Linux systems and is automatically installed during the automated setup process. No additional licensing or activation is required.
Run the following commands to install:
Add the Microsoft package signing key and repository:
$ wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb $ sudo dpkg -i packages-microsoft-prod.deb $ rm packages-microsoft-prod.deb
Install the runtime:
$ sudo apt-get update && \ sudo apt-get install -y aspnetcore-runtime-6.0
For more details, see:
Microsoft .NET Installation Guide for Debian (https://docs.microsoft.com/ru-ru/dotnet/core/install/linux-debian)
Component Installation
Create the required directories, then download and extract the latest component release from GitHub:
$ sudo mkdir /opt/multifactor /opt/multifactor/ssp /opt/multifactor/ssp/app /opt/multifactor/ssp/key-storage $ sudo wget https://github.com/MultifactorLab/multifactor-selfservice-portal/releases/latest/download/MultiFactor.SelfService.Linux.Portal.zip $ sudo unzip MultiFactor.SelfService.Linux.Portal.zip -d /opt/multifactor/ssp/app
Create a dedicated system user mfa and assign ownership and permissions to the application directory:
$ sudo useradd mfa $ sudo chown -R mfa: /opt/multifactor/ssp $ sudo chmod -R 700 /opt/multifactor/ssp
Then create the systemd service file:
$ sudo vi /etc/systemd/system/ssp.service
Replace the contents of the file and save it:
[Unit] Description=Self Service Portal [Service] WorkingDirectory=/opt/multifactor/ssp/app ExecStart=/usr/bin/dotnet /opt/multifactor/ssp/app/MultiFactor.SelfService.Linux.Portal.dll Restart=always RestartSec=10 KillSignal=SIGINT TimeoutStopSec=90 SyslogIdentifier=ssp-service User=mfa Environment=ASPNETCORE_ENVIRONMENT=production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false [Install] WantedBy=multi-user.target
Enable the service to start automatically on boot:
$ sudo systemctl enable ssp.service
Nginx Setup
Install Nginx:
$ sudo apt-get install nginx $ sudo service nginx start
Open your browser and navigate to: http://<server_IP_address>/index.nginx-debian.html. Verify that the default Nginx welcome page is displayed.
Configure Nginx as a Reverse Proxy. Open the Nginx site configuration file: /etc/nginx/sites-available/ssp:
$ sudo vi /etc/nginx/sites-available/ssp
Add the following configuration block and save the file:
server {
# Portal server DNS name
server_name ssp.domain.org;
location / {
# http://<host>:<port> Kestrel
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
listen 80;
}
Then activate the configuration by creating a symbolic link to your custom ssp config file in the sites-enabled directory—this is where Nginx loads active site configurations from at startup:
$ sudo ln -s /etc/nginx/sites-available/ssp /etc/nginx/sites-enabled/
To verify the Nginx configuration, run:
$ sudo nginx -t
If the configuration is valid, apply it by reloading Nginx:
$ sudo nginx -s reload
By default, the reverse proxy operates over unencrypted HTTP. If you need to enable HTTPS with a TLS certificate, update the file /etc/nginx/sites-available/ssp as follows:
server {
server_name ssp.domain.org;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# listen on port 443 with SSL
listen 443 ssl;
# SSL settings
ssl_certificate /etc/letsencrypt/live/ssp.domain.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ssp.domain.org/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
# redirect HTTP traffic to HTTPS
server {
if ($host = ssp.domain.org) {
return 301 https://$host$request_uri;
}
listen 80;
server_name domain.org;
return 404;
}
This configuration assumes you’ve already obtained a TLS certificate using Let’s Encrypt and Certbot. You can achieve similar results by following the official Certbot + Nginx setup instructions for your domain.
Portal Configuration Parameters
The portal’s settings are stored in the following XML file: /opt/multifactor/ssp/app/appsettings.production.xml
Below is a description of each configuration section:
<PortalSettings>
<CompanySettings>
<!-- Your organization's display name -->
<Name>ACME</Name>
<!-- Active Directory domain name used to validate user logins and passwords -->
<Domain>ldaps://dc.domain.local/dc=domain,dc=local</Domain>
<!-- Path to your organization's logo (relative to the web root) -->
<LogoUrl>images/md_logo_white.svg</LogoUrl>
</CompanySettings>
<!-- [Optional] Base DN for FreeIPA integration -->
<!-- <LdapBaseDn>cn=users,cn=accounts,dc=domain,dc=local</LdapBaseDn> -->
<!-- Technical account used to bind to Active Directory -->
<TechnicalAccountSettings>
<User>user@domain.local</User>
<Password>password</Password>
</TechnicalAccountSettings>
<ActiveDirectorySettings requiresUserPrincipalName="false">
<!--
[Optional] Restrict 2FA enrollment to members of a specific AD group for SSO.
If omitted, 2FA is required for all users.
-->
<!-- <SecondFactorGroup>2FA Users</SecondFactorGroup> -->
<!--
[Optional] Use the telephone number stored in the user’s Active Directory "General" tab to send SMS one-time passwords.
This feature is disabled if the setting is removed.
-->
<!-- <UseUserPhone>true</UseUserPhone> -->
<!-- <UseMobileUserPhone>true</UseMobileUserPhone> -->
</ActiveDirectorySettings>
<MultiFactorApiSettings>
<!-- MULTIFACTOR API endpoint URL -->
<ApiUrl>https://api.multifactor.ru</ApiUrl>
<!-- API Key from your MULTIFACTOR customer portal -->
<ApiKey>key</ApiKey>
<!-- API Secret from your MULTIFACTOR customer portal -->
<ApiSecret>secret</ApiSecret>
<!-- [Optional] HTTP proxy for outbound API requests -->
<!-- <ApiProxy>http://proxy:3128</ApiProxy> -->
</MultiFactorApiSettings>
<!-- Logging verbosity: 'Debug', 'Info', 'Warn', 'Error' -->
<LoggingLevel>Info</LoggingLevel>
<!-- Exchange ActiveSync device management (disabled by default) -->
<ExchangeActiveSyncDevicesManagement enabled="false"/>
<!-- UI language: 'ru', 'en', 'auto:ru', 'auto:en' -->
<UICulture>auto:ru</UICulture>
<GroupPolicyPreset>
<!-- [Optional] Assign newly registered users to predefined groups from your MULTIFACTOR customer portal.
Separate multiple group names with semicolons.
-->
<!-- <SignUpGroups>group1;group2;group3</SignUpGroups> -->
</GroupPolicyPreset>
</PortalSettings>
When the UseUserPhone parameter is enabled, the portal retrieves the user’s phone number from the General tab in Active Directory. The phone number format can be arbitrary

Captcha Verification
To protect against automated credential stuffing and brute-force attacks, the portal login page includes optional Captcha verification. Supported Captcha providers: Yandex SmartCaptcha, Google reCAPTCHA. Enabling Captcha ensures that only human users can attempt authentication, significantly reducing the risk of automated attacks on user accounts.
<!-- Enable Captcha verification --> <CaptchaSettings enabled="true"> <!-- Captcha provider: 'Yandex', 'Google' --> <CaptchaType>Yandex</CaptchaType> <!-- Site key from your Captcha provider account --> <Key>key</Key> <!-- Secret key from your Captcha provider account --> <Secret>secret</Secret> <!-- When to display Captcha: 'Always' or 'PasswordRecovery' --> <CaptchaRequired>Always</CaptchaRequired> </CaptchaSettings>
Password Management
The Self-Service Portal enables users to manage their domain passwords, including: сhanging their current password, updating an expired password, resetting a forgotten password.
To use password management features, the portal must connect to the directory service over SSL/TLS (LDAPS).
Password changes for expired accounts are performed using the technical service account configured in the portal settings.
The following parameters are used for configuration:
<!-- Enable password management. Requires LDAPS (SSL/TLS) connection to Active Directory --> <PasswordManagement enabled="true"> <!-- Maximum password change session duration in 'hh:mm:ss' format 'hh:mm:ss' --> <!-- <PasswordChangingSessionLifetime>00:02:00</PasswordChangingSessionLifetime> --> <!-- Session storage cache size in bytes (default: 5242880, minimum: 1048576) --> <!-- <PasswordChangingSessionCachesize>5242880</PasswordChangingSessionCachesize> --> </PasswordManagement>
Forgotten Password Recovery
The password recovery feature allows Active Directory users to reset forgotten or lost passwords independently, without involving IT support.
Prerequisites
- The user must have the Multifactor mobile app configured as an authentication method.
- Password management must be enabled in the portal.
- Captcha verification must be active (to prevent automated attacks).
- The technical service account must have «Reset Password» permissions on the user container in Active Directory.
Configuration
Enable password recovery by setting the allowPasswordRecovery parameter in the <PasswordManagement> section:
<!-- Forgotten password recovery. Set allowPasswordRecovery to "true" to enable, "false" to disable --> <PasswordManagement enabled="true" allowPasswordRecovery="true"> </PasswordManagement>
Starting the Service
After configuring the settings, start the portal service:
$ sudo systemctl start ssp.service
Check the service status with:
$ sudo systemctl status ssp.service
After any changes to the service configuration file (e.g., ssp.service), reload the systemd manager and restart the service:
$ sudo systemctl daemon-reload $ sudo systemctl restart ssp.service
Logs
Portal logs are written to syslog and also saved as text files in the directory: /opt/multifactor/ssp/app/logs
Note: If the directory is missing or empty, verify that the service user (mfa) has write permissions to this directory.
To view syslog entries for the portal, use the following command:
$ sudo less /var/log/syslog
Alternatively, you can inspect the system log directly:
$ sudo journalctl -fu ssp.service
Accessing the Portal
The portal is available at: https://ssp.domain.org.
Liveness Check
To verify that the portal is running and responsive, use the built-in health check endpoint: GET https://ssp.domain.org/api/ping.
Example response:
{
"timeStamp": "2022-08-05T08:19:42.336Z",
"message": "Ok"
}
Q&A
Q: Why can’t a user reset their password even though the portal’s technical account has «Reset Password» permissions on the user container?
A: Active Directory enforces special security restrictions for members of privileged groups (e.g., Domain Admins). These accounts do not inherit ACLs from parent containers due to AdminSDHolder protection. To allow password resets for such users, you must explicitly grant the «Reset Password» permission directly on each privileged user object—not just at the container level.
Q: How do I change the interface and port that the Kestrel web server listens on?
A: Add a <Kestrel> configuration block to your appsettings.production.xml file. Specify the binding address and port in the <Url> node:
<Kestrel>
<Endpoints>
<Http>
<!-- http://interface:port -->
<Url>http://localhost:5000</Url>
</Http>
</Endpoints>
</Kestrel>
<PortalSettings>
...
</PortalSettings>
For more details, see Microsoft’s official documentation: