If you want to enable LDAP authentication mode, Set the following environment variable name and value:

Variable nameValue
AUTHENTICATION_MODEldap

In this case, you will also need to configure the following variables:

Variable nameDescriptionExample value
LDAP_ADMIN_USERNAMEThe username of the owner user created on first runadmin
LDAP_SERVERThe host of the LDAP serverldap.example.com
LDAP_BIND_DNThe bind_dn for the LDAP account that will be used to perform search operationscn=admin,dc=example,dc=com
LDAP_BIND_PASSWORDThe password for the LDAP account that will be used to perform search operationspassword
LDAP_BASE_DNThe base DN of the serverdc=example,dc=com
LDAP_AUTHENTICATION_FILTERThe authentication filter to use in template format using the variable username(&(|(objectClass=inetOrgPerson)(objectClass=groupOfNames))(cn={username}))
LDAP_AUTHORIZATION_FILTERThe authorization filter to use in template format using the variable user_dn(&(objectClass=groupOfNames)(cn=group)(member={user_dn}))
LDAP_GROUP_FIELDName of user attribute to use to determine a user’s LDAP group.memberOf
LDAP_ROLES_MAPPINGMapping of user LDAP group to Mage roles. Must be in JSON string format.'{"Admin": ["Admin"]}'
LDAP_DEFAULT_ACCESSDefault access for a new user authenticated through LDAP (default user will have no role)Viewer, Editor, Admin
UPDATE_ROLES_ON_LOGINUpdate roles on every login. Otherwise, the roles will only be set when the user logs in for the first time.1

Make sure to adjust the values of the variables to match your LDAP configuration.

When LDAP authentication is enabled, users will need to provide their LDAP credentials to log in to the system. Once authenticated, Mage will use the authorization filter to determine the user’s permissions based on their LDAP group membership.

Was this page helpful?