To setup your CodiMD instance with Active Directory you need to set the following variables:
CMD_LDAP_BINDDN
is either the distinguishedName
or the userPrincipalName
.
You would see the error: "username/password is invalid" if CMD_LDAP_BINDDN
or CMD_LDAP_BINDCREDENTIALS
is incorrect
CMD_LDAP_SEARCHFILTER
will search through all users with either the email address or the sAMAccountName
(usually the login name used to login to Windows).
CMD_LDAP_SEARCHFILTER
should be in this format: (&(objectcategory=person)(objectclass=user)(|(sAMAccountName={{username}})(mail={{username}})))
CMD_LDAP_USERIDFIELD
means: we want to use sAMAccountName
as the unique identifier for the account itself.
CMD_LDAP_PROVIDERNAME
is just the name on the login page above the username and password field.
More details and example: https://www.npmjs.com/package/passport-ldapauth
CodiMD
Docs