--- alias: operation-guide-security-portal-strategy-activedirectory description: "Sign in users with their Windows Active Directory account, validated by the Security Portal over LDAP." --- # Windows Active Directory The **Windows Active Directory** strategy signs in users with their Windows Active Directory account. The Security Portal validates the user name and password against Active Directory over LDAP or LDAPS. Users sign in as `DOMAIN\user`, and the strategy matches them to the MES User with that account. For other LDAP directories, use the [[operation-guide-security-portal-strategy-ldap|LDAP Server]] strategy. Before configuring the strategy, collect the address of the Active Directory server, the base distinguished name where the user search starts, and a user with permission to search Active Directory. ## Account logon restrictions The Security Portal uses the configured lookup account (`ldap.user`) to find the user in Active Directory, then performs an LDAP bind with the signing-in user's credentials. A successful directory search does not mean that the user can authenticate: Active Directory must also accept the user bind. This applies over both LDAP and LDAPS, including when the **LDAP Server** strategy connects to Active Directory. Active Directory checks account restrictions as well as the password. A user can therefore enter the correct password and still be unable to sign in to MES. The Security Portal cannot authenticate a user whose bind is rejected by Active Directory. ### Workstation restrictions (Log On To) In Active Directory Users and Computers, the user's **Account > Log On To...** setting restricts the computers from which the account can sign in. It is stored in the `userWorkstations` attribute. When this restriction excludes the domain controller that handles an LDAP simple bind, Active Directory can reject the bind. Being allowed to sign in on the user's workstation alone may therefore be insufficient for MES authentication through this strategy. This restriction is separate from permission to open a console or Remote Desktop session on the domain controller. MES authentication does not require granting users interactive access to the domain controller. If this restriction prevents sign-in: 1. Ask the Active Directory administrator to inspect the failed user bind. A generic invalid user name or password message in MES does not identify the underlying directory restriction. 2. Check for LDAP result code `49` with Active Directory diagnostic `data 531`. The hexadecimal diagnostic `531` corresponds to Windows error `1329` (`ERROR_INVALID_WORKSTATION`), which identifies a workstation logon restriction. LDAP code `49` alone does not establish this cause. See [Microsoft's system error codes](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699-). 3. Review the affected user's **Log On To...** setting with the administrator. If `userWorkstations` must remain in use, the administrator must assess whether the domain controllers handling these binds need to be included in the permitted computers. Account for all controllers that can serve the configured LDAP endpoint, including failover. 4. If the goal is to prevent interactive access to the domain controller, have the administrator configure the local and Remote Desktop logon rights instead. Microsoft recommends these policies in place of `userWorkstations`; see the [User-Workstations attribute](https://learn.microsoft.com/en-us/windows/win32/adschema/a-userworkstations). Retest MES sign-in after the approved policy changes take effect. ## Configuration Available out of the box with the ID `ActiveDirectory`. Enable and configure it in DevOps Center during the installation, with the domain, address, base DN, user name, password, port, SSL, and certificate validation settings. Disabled by default. For more than one domain, see [Multiple Domains](#multiple-domains). ### Parameters | **Strategy type** | **Plugin** | |-------------------------|--------------------------------------------| | `local-ActiveDirectory` | `@criticalmanufacturing/auth-plugin-local` | Table: Windows Active Directory strategy type and plugin Each strategy entry also accepts the [common strategy properties](../security-portal-configuration/security_portal_config_securityportal.md#common-strategy-properties). | **Parameter** | **Required** | **Description** | |-------------------------------------|--------------|----------------------------------------------------------------------------------------------------------------------------| | `defaultDomain` | No | Domain added to the user name when the user signs in without a `DOMAIN\` prefix. | | `ldap.url` | Yes | Address of the Active Directory server, for example `ldap://example.com`. Use an `ldaps://` address to connect over LDAPS. | | `ldap.base` | Yes | Base distinguished name where the search starts, for example `DC=example,DC=com`. | | `ldap.user` | Yes | User with permission to search Active Directory. | | `ldap.password` | Yes | Password of `ldap.user`. | | `ldap.disableCertificateValidation` | No | Set to `true` to skip the validation of the LDAPS server certificate. Default: `false`. | | `ldap.caCertificatePath` | No | Path of the CA certificate that validates the LDAPS server certificate. If omitted, the system certificate store is used. | Table: Windows Active Directory strategy parameters ### Example ```json { "id": "ActiveDirectory", "type": "local-ActiveDirectory", "config": { "defaultDomain": "", "ldap": { "url": "ldap://", "base": "DC=,DC=", "user": "", "password": "" } } } ``` ### Multiple Domains To sign in users from more than one Active Directory domain, configure one `local-ActiveDirectory` strategy per domain. See [[operation-guide-multipledomains]].