[Unit]
Description=Multifactor Ldap Adapter
[Service]
WorkingDirectory=/opt/multifactor/ldap/
ExecStart=/usr/bin/dotnet /opt/multifactor/ldap/multifactor-ldap-adapter.dll
Restart=always
# Restart service after 10 seconds if the service crashes:
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=multifactor-ldap
User=mfa
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
# How many seconds to wait for the app to shut down after it receives the initial interrupt signal.
# If the app doesn't shut down in this period, SIGKILL is issued to terminate the app.
# The default timeout for most distributions is 90 seconds.
TimeoutStopSec=30
# give the executed process the CAP_NET_BIND_SERVICE capability. This capability allows the process to bind to well known ports.
AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
sudo systemctl enable multifactor-ldap
Регистрация ресурса на Multifactor
Выбираем LDAP приложение
Мы получили NAS Identifier и Shared Secrer , далее мы его будем использовать в конфигурации
Конфигурация
Параметры работы компонента хранятся в файле /opt/multifactor/ldap/multifactor-ldap-adapter.dll.config .
Копируем дефолтный конфиг и начинаем его редактировать
cd /opt/multifactor/ldap/clients/
nano /opt/multifactor/ldap/clients/multifactor-ldap-adapter.dll.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- The address and port (TCP) on which the adapter will listen to LDAP requests -->
<!-- If you specify 0.0.0.0, then the adapter will listen on all network interfaces -->
<add key="adapter-ldap-endpoint" value="0.0.0.0:389"/>
<!-- The address and port (TCP) on which the adapter will listen for LDAPS encrypted requests -->
<!-- If you specify 0.0.0.0, then the adapter will listen on all network interfaces -->
<add key="adapter-ldaps-endpoint" value="0.0.0.0:636"/>
<!-- IP адрес сетевого устройства, которое будет подключаться к адаптеру -->
<add key="ldap-client-ip" value="172.16.1.135"/>
<!-- Active Directory domain address or name, and ldap or ldaps connection scheme -->
<add key="ldap-server" value="ldaps://corp.local"/>
<!-- [Опционально] Запрашивать второй фактор только у пользователей из указанной группы (второй фактор требуется всем, если удалить настройку) -->
<add key="active-directory-2fa-group" value="Bitrix24"/>
<!-- [Опционально] Не запрашивать второй фактор у пользователей из указанной группы (в том числе, если пользователь одновременно находится в группе, заданной в active-directory-2fa-gr$
<add key="active-directory-2fa-bypass-group" value="Bitrix24bypass"/>
<!-- Multifactor API address -->
<add key="multifactor-api-url" value="https://api.multifactor.ru"/>
<!--Timeout for requests in the Multifactor API, the minimum value is 65 seconds-->
<add key="multifactor-api-timeout" value="00:01:05"/>
<!-- NAS-Identifier parameter to connect to the Multifactor API - from resource details in your account -->
<add key="multifactor-nas-identifier" value="rs_4bd7243434343438fff44774"/>
<!-- Shared Secret parameter to connect to the Multifactor API - from resource details in your account -->
<add key="multifactor-shared-secret" value="442c4343434394a6d8937"/>
<!-- Access to the Multifactor API via HTTP proxy (optional) -->
<!--add key="multifactor-api-proxy" value="http://proxy:3128"/-->
<!-- Logging level: 'Debug', 'Info', 'Warn', 'Error' -->
<add key="logging-level" value="Debug"/>
<!--certificate password leave empty or null for certificate without password-->
<!--<add key="certificate-password" value="XXXXXX"/>-->
</appSettings>
</configuration>