You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: _posts/2019-04-15-gl-config.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -266,8 +266,34 @@ Greenlight is able to authenticate users using an external LDAP server. To conne
266
266
267
267
> `LDAP_BIND_DN` is the default account to use for user lookup.
268
268
269
+
> `LDAP_AUTH` is the preferred authentication method. (See below)
270
+
269
271
> `LDAP_PASSWORD` is the password for the account to perform user lookup.
270
272
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
+
271
297
Here are some example settings using an [OpenLDAP](http://www.openldap.org/) server.
272
298
273
299
```
@@ -276,8 +302,11 @@ LDAP_PORT=389
276
302
LDAP_METHOD=plain
277
303
LDAP_UID=uid
278
304
LDAP_BASE=dc=example,dc=org
305
+
LDAP_AUTH=simple
279
306
LDAP_BIND_DN=cn=admin,dc=example,dc=org
280
307
LDAP_PASSWORD=password
308
+
LDAP_ROLE_FIELD=userRole
309
+
LDAP_FILTER=(&(attr1=value1)(attr2=value2))
281
310
```
282
311
283
312
If your server is still running you will need to recreate the container for changes to take effect.
0 commit comments