Skip to content

Commit 7749a72

Browse files
authored
Merge pull request #968 from SISheogorath/docs/ldap-AD
Add documentation for an LDAP setup against Active Directory
2 parents da81838 + 3122e35 commit 7749a72

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/guides/auth/ldap-AD.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
AD LDAP auth
2+
===
3+
4+
5+
To setup your CodiMD instance with Active Directory you need the following configs:
6+
7+
```
8+
CMD_LDAP_URL=ldap://internal.example.com
9+
CMD_LDAP_BINDDN=cn=binduser,cn=Users,dc=internal,dc=example,dc=com
10+
CMD_LDAP_BINDCREDENTIALS=<super secret password>
11+
CMD_LDAP_SEARCHBASE=dc=internal,dc=example,dc=com
12+
CMD_LDAP_SEARCHFILTER=(&(objectcategory=person)(objectclass=user)(|(sAMAccountName={{username}})(mail={{username}})))
13+
CMD_LDAP_USERIDFIELD=sAMAccountName
14+
CMD_LDAP_PROVIDERNAME=Example Inc AD
15+
```
16+
17+
18+
`CMD_LDAP_BINDDN` is either the `distinguishedName` or the `userPrincipalName`. *This can cause "username/password is invalid" when either this value or the password from `CMD_LDAP_BINDCREDENTIALS` are incorrect.*
19+
20+
`CMD_LDAP_SEARCHFILTER` matches on all users and uses either the email address or the `sAMAccountName` (usually the login name you also use to login to Windows).
21+
22+
*Only using `sAMAccountName` looks like this:* `(&(objectcategory=person)(objectclass=user)(sAMAccountName={{username}}))`
23+
24+
`CMD_LDAP_USERIDFIELD` says we want to use `sAMAccountName` as unique identifier for the account itself.
25+
26+
`CMD_LDAP_PROVIDERNAME` just the name written above the username and password field on the login page.
27+
28+
29+
Same in json:
30+
31+
```json
32+
"ldap": {
33+
"url": "ldap://internal.example.com",
34+
"bindDn": "cn=binduser,cn=Users,dc=internal,dc=example,dc=com",
35+
"bindCredentials": "<super secret password>",
36+
"searchBase": "dc=internal,dc=example,dc=com",
37+
"searchFilter": "(&(objectcategory=person)(objectclass=user)(|(sAMAccountName={{username}})(mail={{username}})))",
38+
"useridField": "sAMAccountName",
39+
},
40+
```
41+
42+
More details and example: https://www.npmjs.com/package/passport-ldapauth

0 commit comments

Comments
 (0)