mirror of
https://github.com/nitnelave/lldap.git
synced 2023-04-12 14:25:13 +00:00
Merge branch 'main' into grafana-conf
This commit is contained in:
commit
1f063d4402
@ -199,11 +199,13 @@ folder for help with:
|
||||
- [Authelia](example_configs/authelia_config.yml)
|
||||
- [Bookstack](example_configs/bookstack.env.example)
|
||||
- [Dolibarr](example_configs/dolibarr.md)
|
||||
- [Gitea](example_configs/gitea.md)
|
||||
- [Jellyfin](example_configs/jellyfin.md)
|
||||
- [Jisti Meet](example_configs/jitsi_meet.conf)
|
||||
- [KeyCloak](example_configs/keycloak.md)
|
||||
- [Matrix](example_configs/matrix_synapse.yml)
|
||||
- [Organizr](example_configs/Organizr.md)
|
||||
- [Seafile](example_configs/seafile.md)
|
||||
|
||||
## Comparisons with other services
|
||||
|
||||
|
22
example_configs/gitea.md
Normal file
22
example_configs/gitea.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Configuration for Gitea
|
||||
In Gitea, go to `Site Administration > Authentication Sources` and click `Add Authentication Source`
|
||||
Select `LDAP (via BindDN)`
|
||||
|
||||
* Host: Your lldap server's ip/hostname
|
||||
* Port: Your lldap server's port (3890 by default)
|
||||
* Bind DN: `uid=admin,ou=people,dc=example,dc=com`
|
||||
* Bind Password: Your bind user's password
|
||||
* User Search Base: `ou=people,dc=example,dc=com`
|
||||
* User Filter: If you want all users to be able to log in, use<br>
|
||||
`(&(objectClass=person)(|(uid=%[1]s)(mail=%[1]s)))`.<br>
|
||||
To log in they can either use their email address or user name. If you only want members a specific group to be able to log in, in this case the group `git_user`, use<br>
|
||||
`(&(memberof=cn=git_user,ou=groups,dc=example,dc=com)(|(uid=%[1]s)(mail=%[1]s)))`<br>
|
||||
For more info on the user filter, see: https://docs.gitea.io/en-us/authentication/#ldap-via-binddn
|
||||
* Admin Filter: Use `(memberof=cn=lldap_admin,ou=groups,dc=example,dc=com)` if you want lldap admins to become Gitea admins. Leave empty otherwise.
|
||||
* Username Attribute: `uid`
|
||||
* Email Attribute: `mail`
|
||||
* Check `Enable User Synchronization`
|
||||
|
||||
Replace every instance of `dc=example,dc=com` with your configured domain.
|
||||
|
||||
After applying the above settings, users should be able to log in with either their user name or email address.
|
@ -1,49 +1,64 @@
|
||||
# Configuration for Portainer CE
|
||||
## Settings > Authentication
|
||||
# Configuration for Portainer CE/BE
|
||||
### Settings > Authentication > LDAP > Custom
|
||||
---
|
||||
|
||||
## LDAP configuration
|
||||
### LDAP Server
|
||||
## LDAP configuration
|
||||
|
||||
#### LDAP Server
|
||||
```
|
||||
localhost:3890
|
||||
localhost:3890 or ip-address:3890
|
||||
```
|
||||
### Anonymous mode
|
||||
#### Anonymous mode
|
||||
```
|
||||
off
|
||||
```
|
||||
### Reader DN
|
||||
#### Reader DN
|
||||
```
|
||||
uid=admin,ou=people,dc=example,dc=com
|
||||
```
|
||||
### Password
|
||||
#### Password
|
||||
```
|
||||
xxx
|
||||
```
|
||||
* Password is the ENV you set at *LLDAP_LDAP_USER_PASS=* or `lldap_config.toml`
|
||||
|
||||
## User search configurations
|
||||
### Base DN
|
||||
|
||||
#### Base DN
|
||||
```
|
||||
ou=people,dc=example,dc=com
|
||||
```
|
||||
### Username attribute
|
||||
#### Username attribute
|
||||
```
|
||||
uid
|
||||
```
|
||||
### Filter
|
||||
### Filter
|
||||
#### All available user(s)
|
||||
```
|
||||
(objectClass=person)
|
||||
```
|
||||
* Using this filter will list all user registered in LLDAP
|
||||
|
||||
#### All user(s) from specific group
|
||||
```
|
||||
(&(objectClass=person)(memberof=cn=lldap_portainer,ou=groups,dc=example,dc=com))
|
||||
```
|
||||
* Using this filter will only list user that included in `lldap_portainer` group.
|
||||
* Admin should manually configure groups and add a user to it. **lldap_portainer** only sample.
|
||||
|
||||
|
||||
|
||||
## Group search configurations
|
||||
### Group Base DN
|
||||
|
||||
#### Group Base DN
|
||||
```
|
||||
ou=groups,dc=example,dc=com
|
||||
```
|
||||
### Group Membership Attribute
|
||||
#### Group Membership Attribute
|
||||
```
|
||||
cn
|
||||
```
|
||||
### Group Filter
|
||||
#### Group Filter
|
||||
```
|
||||
is optional
|
||||
```
|
||||
|
89
example_configs/seafile.md
Normal file
89
example_configs/seafile.md
Normal file
@ -0,0 +1,89 @@
|
||||
# Configuration for Seafile
|
||||
Seafile's LDAP interface requires a unique, immutable user identifier in the format of `username@domain`. Since LLDAP does not provide an attribute like `userPrincipalName`, the only attribute that somewhat qualifies is therefore `mail`. However, using `mail` as the user identifier results in the issue that Seafile will treat you as an entirely new user if you change your email address through LLDAP. If this is not an issue for you, you can configure LLDAP as an authentication source in Seafile directly. A better but more elaborate way to use Seafile with LLDAP is by using Authelia as an intermediary. This document will guide you through both setups.
|
||||
|
||||
## Configuring Seafile to use LLDAP directly
|
||||
Add the following to your `seafile/conf/ccnet.conf` file:
|
||||
```
|
||||
[LDAP]
|
||||
HOST = ldap://192.168.1.100:3890
|
||||
BASE = ou=people,dc=example,dc=com
|
||||
USER_DN = uid=admin,ou=people,dc=example,dc=com
|
||||
PASSWORD = CHANGE_ME
|
||||
LOGIN_ATTR = mail
|
||||
```
|
||||
* Replace `192.168.1.100:3890` with your LLDAP server's ip/hostname and port.
|
||||
* Replace every instance of `dc=example,dc=com` with your configured domain.
|
||||
|
||||
After restarting the Seafile server, users should be able to log in with their email address and password.
|
||||
|
||||
### Filtering by group membership
|
||||
If you only want members of a specific group to be able to log in, add the following line:
|
||||
```
|
||||
FILTER = memberOf=cn=seafile_user,ou=groups,dc=example,dc=com
|
||||
```
|
||||
* Replace `seafile_user` with the name of your group.
|
||||
|
||||
## Configuring Seafile to use LLDAP with Authelia as an intermediary
|
||||
Authelia is an open-source authentication and authorization server that can use LLDAP as a backend and act as an OpenID Connect Provider. We're going to assume that you have already set up Authelia and configured it with LLDAP.
|
||||
If not, you can find an example configuration [here](authelia_config.yml).
|
||||
|
||||
1. Add the following to Authelia's `configuration.yml`:
|
||||
```
|
||||
identity_providers:
|
||||
oidc:
|
||||
hmac_secret: Your_HMAC_Secret #Replace with a random string
|
||||
issuer_private_key: |
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
Your_Private_Key
|
||||
#See https://www.authelia.com/configuration/identity-providers/open-id-connect/#issuer_private_key for instructions on how to generate a key
|
||||
-----END RSA PRIVATE KEY-----
|
||||
cors:
|
||||
endpoints:
|
||||
- authorization
|
||||
- token
|
||||
- revocation
|
||||
- introspection
|
||||
- userinfo
|
||||
clients:
|
||||
- id: seafile
|
||||
description: Seafile #The display name of the application. Will show up on Authelia consent screens
|
||||
secret: Your_Shared_Secret #Replace with random string
|
||||
public: false
|
||||
authorization_policy: one_factor #Can also be two_factor
|
||||
scopes:
|
||||
- openid
|
||||
- profile
|
||||
- email
|
||||
redirect_uris:
|
||||
- https://seafile.example.com/oauth/callback/
|
||||
userinfo_signing_algorithm: none
|
||||
pre_configured_consent_duration: 6M
|
||||
#On first login you must consent to sharing information between Authelia and Seafile. This option configures the amount of time after which you need to reconsent.
|
||||
# y = years, M = months, w = weeks, d = days
|
||||
```
|
||||
|
||||
2. Add the following to `seafile/conf/seahub_settings.py`
|
||||
```
|
||||
ENABLE_OAUTH = True
|
||||
OAUTH_ENABLE_INSECURE_TRANSPORT = True
|
||||
OAUTH_CLIENT_ID = 'seafile' #Must be the same as in Authelia
|
||||
OAUTH_CLIENT_SECRET = 'Your_Shared_Secret' #Must be the same as in Authelia
|
||||
OAUTH_REDIRECT_URL = 'https://seafile.example.com/oauth/callback/'
|
||||
OAUTH_PROVIDER_DOMAIN = 'auth.example.com'
|
||||
OAUTH_AUTHORIZATION_URL = 'https://auth.example.com/api/oidc/authorization'
|
||||
OAUTH_TOKEN_URL = 'https://auth.example.com/api/oidc/token'
|
||||
OAUTH_USER_INFO_URL = 'https://auth.example.com/api/oidc/userinfo'
|
||||
OAUTH_SCOPE = [
|
||||
"openid",
|
||||
"profile",
|
||||
"email",
|
||||
]
|
||||
OAUTH_ATTRIBUTE_MAP = {
|
||||
"preferred_username": (True, "email"), #Seafile will create a unique identifier of your <LLDAP's User ID >@<the value specified in OAUTH_PROVIDER_DOMAIN>. The identifier is not visible to the user and not actually used as the email address unlike the value suggests
|
||||
"name": (False, "name"),
|
||||
"id": (False, "not used"),
|
||||
"email": (False, "contact_email"),
|
||||
}
|
||||
```
|
||||
|
||||
Restart both your Authelia and Seafile server. You should see a "Single Sign-On" button on Seafile's login page. Clicking it should redirect you to Authelia. If you use the [example config for Authelia](authelia_config.yml), you should be able to log in using your LLDAP User ID.
|
30
example_configs/syncthing.md
Normal file
30
example_configs/syncthing.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Configuration for Syncthing
|
||||
## Actions > Advanced > LDAP
|
||||
---
|
||||
|
||||
| Parameter | Value | Details |
|
||||
|----------------------|------------------------------------------------------------------------|-------------------------------------------------------|
|
||||
| Address | `localhost:3890` | Replace `localhost:3890` with your LLDAP host & port |
|
||||
| Bind DN | `cn=%s,ou=people,dc=example,dc=com` | |
|
||||
| Insecure Skip Verify | *unchecked* | |
|
||||
| Search Base DN | `ou=people,dc=example,dc=com` | Only used when using filters. |
|
||||
| Search Filter | `(&(uid=%s)(memberof=cn=lldap_syncthing,ou=groups,dc=example,dc=com))` | Filters on users belonging to group `lldap_syncthing` |
|
||||
| Transport | `plain` | |
|
||||
|
||||
Replace `dc=example,dc=com` with your LLDAP configured domain for all occurances
|
||||
|
||||
Leave **Search Base DN** and **Search Filter** both blank if you are not using any filters.
|
||||
|
||||
## Actions > Advanced > GUI
|
||||
|
||||
Change **Auth Mode** from `static` to `ldap`
|
||||
|
||||
|
||||
If you get locked out of the UI due to invalid LDAP settings, you can always change the settings from the `config.xml`, save the file, and force restart the app.
|
||||
|
||||
### Example
|
||||
|
||||
Change the below and restart
|
||||
|
||||
` <authMode>ldap</authMode>` to ` <authMode>static</authMode>`
|
||||
|
Loading…
Reference in New Issue
Block a user