Skip to content

Commit 38ba0f6

Browse files
brodoTomWFoxdplewis
committed
Add documentation for the LDAP auth module (#685)
* Add documentation for the LDAP auth module * fix typo in LDAP auth module Co-Authored-By: Tom Fox <13188249+TomWFox@users.noreply.github.com> * Remove line breaks and typo I hope this resolves all issues * Delete line breaks Co-authored-by: Tom Fox <13188249+TomWFox@users.noreply.github.com> Co-authored-by: Diamond Lewis <findlewis@gmail.com>
1 parent 8cf7db7 commit 38ba0f6

File tree

1 file changed

+68
-17
lines changed

1 file changed

+68
-17
lines changed

_includes/parse-server/third-party-auth.md

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@ Parse Server supports 3rd party authentication with
1010
* Instagram
1111
* Janrain Capture
1212
* Janrain Engage
13+
* LDAP
1314
* LinkedIn
1415
* Meetup
16+
* Microsoft Graph
1517
* PhantAuth
1618
* QQ
1719
* Spotify
1820
* Twitter
1921
* vKontakte
2022
* WeChat
2123
* Weibo
22-
* Microsoft Graph
2324

2425
Configuration options for these 3rd-party modules is done with the `auth` option passed to Parse Server:
2526

@@ -188,6 +189,56 @@ Google oauth supports validation of id_token's and access_token's.
188189
}
189190
```
190191

192+
### Configuring Parse Server for LDAP
193+
194+
The [LDAP](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol) module can check if a
195+
user can authenticate (bind) with the given credentials. Optionally, it can also check if the user is in a certain group.
196+
This check is done using a user specified query, called an [LDAP Filter](https://ldap.com/ldap-filters/).
197+
The query should return all groups which the user is a member of. The `cn` attribute of the query results is compared to `groupCn`.
198+
199+
To build a query which works with your LDAP server, you can use a LDAP client like [Apache Directory Studio](https://directory.apache.org/studio/).
200+
201+
```js
202+
{
203+
"ldap": {
204+
"url": "ldap://host:port",
205+
"suffix": "the root of your LDAP tree",
206+
"dn": "Bind dn. {{id}} is replaced with the id suppied in authData",
207+
"groupCn": "Optional. A group which the user must be a member of.",
208+
"groupFilter": "Optional. An LDAP filter for finding groups which the user is part of. {{id}} is replaced with the id supplied in authData."
209+
}
210+
}
211+
```
212+
213+
If either `groupCN` or `groupFilter` is not specified, the group check is not performed.
214+
215+
Example Configuration (this works with the public LDAP test server hosted by Forumsys):
216+
217+
```js
218+
{
219+
"ldap": {
220+
"url": "ldap://ldap.forumsys.com:389",
221+
"suffix": "dc=example,dc=com",
222+
"dn": "uid={{id}}, dc=example, dc=com",
223+
"groupCn": "Chemists",
224+
"groupFilter": "(&(uniqueMember=uid={{id}},dc=example,dc=com)(objectClass=groupOfUniqueNames))"
225+
}
226+
}
227+
```
228+
229+
authData:
230+
231+
```js
232+
{
233+
"authData": {
234+
"ldap": {
235+
"id": "user id",
236+
"password": "password"
237+
}
238+
}
239+
}
240+
```
241+
191242
### LinkedIn `authData`
192243

193244
```js
@@ -211,6 +262,22 @@ Google oauth supports validation of id_token's and access_token's.
211262
}
212263
```
213264

265+
### Microsoft Graph `authData`
266+
267+
```js
268+
{
269+
"microsoft": {
270+
"id": "user's microsoft id (string)", // required
271+
"access_token": "an authorized microsoft graph access token for the user", // required
272+
"mail": "user's microsoft email (string)"
273+
}
274+
}
275+
```
276+
277+
Learn more about [Microsoft Graph Auth Overview](https://docs.microsoft.com/en-us/graph/auth/?view=graph-rest-1.0).
278+
279+
To [get access on behalf of a user](https://docs.microsoft.com/en-us/graph/auth-v2-user?view=graph-rest-1.0).
280+
214281
### PhantAuth `authData`
215282

216283
As of Parse Server 3.7.0 you can use [PhantAuth](https://www.phantauth.net/).
@@ -294,22 +361,6 @@ Learn more about [PhantAuth](https://www.phantauth.net/).
294361
}
295362
```
296363

297-
### Microsoft Graph `authData`
298-
299-
```js
300-
{
301-
"microsoft": {
302-
"id": "user's microsoft id (string)", // required
303-
"access_token": "an authorized microsoft graph access token for the user", // required
304-
"mail": "user's microsoft email (string)"
305-
}
306-
}
307-
```
308-
309-
Learn more about [Microsoft Graph Auth Overview](https://docs.microsoft.com/en-us/graph/auth/?view=graph-rest-1.0).
310-
311-
To [get access on behalf of a user](https://docs.microsoft.com/en-us/graph/auth-v2-user?view=graph-rest-1.0).
312-
313364
## Custom authentication
314365

315366
It is possible to leverage the OAuth support with any 3rd party authentication that you bring in.

0 commit comments

Comments
 (0)