Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 737237f

Browse files
authored
Greenlight-v2.5.5 LDAP changes (#132)
1 parent 5d35372 commit 737237f

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

_posts/2019-04-15-gl-config.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,34 @@ Greenlight is able to authenticate users using an external LDAP server. To conne
266266
267267
> `LDAP_BIND_DN` is the default account to use for user lookup.
268268
269+
> `LDAP_AUTH` is the preferred authentication method. (See below)
270+
269271
> `LDAP_PASSWORD` is the password for the account to perform user lookup.
270272
273+
> `LDAP_ROLE_FIELD` is the name of the attribute that contains the user role. (Optional)
274+
275+
> `LDAP_FILTER` is the filter which can be used to only allow a specific subset of users to authenticate. (Optional)
276+
277+
#### LDAP_AUTH
278+
279+
When setting the authentication method, there are currently 3 options:
280+
- `"simple"`: Uses the account set in `LDAP_BIND_DN` to look up users
281+
- `"user"`: Uses the user's own credentials to search for his data, enabling authenticated login to LDAP without the need for a user with global read privileges.
282+
- `"anonymous"`: Enables an anonymous bind to the LDAP with no password being used.
283+
284+
#### LDAP_ROLE_FIELD
285+
286+
Greenlight can automatically assign a matching role to a user based on their role in the LDAP Server. To do that:
287+
- Create a role in Greenlight with the **exact** same name as the LDAP role
288+
- Set the role permissions for the newly created role
289+
- Repeat for all possible roles
290+
- Set `LDAP_ROLE_FIELD` equal to the name of the attribute that stores the role
291+
- Restart Greenlight
292+
293+
Once you have signed in with that user, they will automatically be given the Greenlight role that matches their LDAP role.
294+
295+
#### Example Setup
296+
271297
Here are some example settings using an [OpenLDAP](http://www.openldap.org/) server.
272298
273299
```
@@ -276,8 +302,11 @@ LDAP_PORT=389
276302
LDAP_METHOD=plain
277303
LDAP_UID=uid
278304
LDAP_BASE=dc=example,dc=org
305+
LDAP_AUTH=simple
279306
LDAP_BIND_DN=cn=admin,dc=example,dc=org
280307
LDAP_PASSWORD=password
308+
LDAP_ROLE_FIELD=userRole
309+
LDAP_FILTER=(&(attr1=value1)(attr2=value2))
281310
```
282311
283312
If your server is still running you will need to recreate the container for changes to take effect.

0 commit comments

Comments
 (0)