LDAP3 password provider for Synapse
Project description
Synapse LDAP pasword provider
Allows synapse to use LDAP database as a password provider.
Allows to map mail and msisdn (phone) from LDAP (check usage note!)
Allows implementing independent account lockout policy, to prevent Active Directory users locking by external bruteforce attack.
Travis-CI Build Status
Installation
Via python’s package manager: pip install synapse-ldap-password-provider
Via python’s package manager from git: pip install https://github.com/slipeer/synapse-ldap-password-provider/tarball/master
Usage
Example synapse config:
password_providers:
- module: "synapse_ldap_password_provider.LDAPPasswordProvider"
config:
enabled: true
uri: "ldap://ldap.example.com:389"
start_tls: true
base: "ou=users,dc=example,dc=com"
attributes:
uid: "samaccountname"
name: "DisplayName"
# Optional. Please read usage note!
mail: "email"
# Optional. Please read usage note!
msisdn: "phone"
#bind_dn:
#bind_password:
#filter: "(&(objectClass=user)(objectCategory=person))"
# If you do not want your internal users to be blocked from outside
# by scrambling passwords through this service, then you need
# implement a more rigid account lockout policy then in yor LDAP server
# This example user locks after 5 badd attemps to 5 minutes
account_lockout_policy:
locktime_s: 300
attemps: 5
Do not use cn attribute as uid. It’s common mistake: cn attribute not uniqe in LDAP tree in most schemas! It’s work fine only in very simple LDAP installations without complex Organizational Units structire. You can use: samaccountname, uid or userPrincipalName (depending on the schemes in your system). These attributes are always unique.
Usage note
Use attributes mail and msisdn from the LDAP only if your identity server is also integrated with LDAP and looks for 3pd in these attributes. Otherwise it will not work properly. If you seach identity server with LDAP integration you can try my sydent fork https://github.com/slipeer/sydent
Account Lockout Policy
If you do not want your internal users to be blocked from outside by scrambling passwords through this service, then you need implement a more rigid account lockout policy then on your LDAP server.
Troubleshooting and Debugging
synapse-ldap-password-provider logging is included in the Synapse homeserver log (typically homeserver.log). The LDAP plugin log level can be increased to DEBUG for troubleshooting and debugging by making the following modifications to your Synapse server’s logging configuration file:
Set the value for handlers.file.level to DEBUG:
handlers:
file:
# [...]
level: DEBUG
Add the following to the loggers section:
loggers:
# [...]
ldap3:
level: DEBUG
synapse_ldap_password_provider:
level: DEBUG
Finally, restart your Synapse server for the changes to take effect:
synctl restart
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file synapse_ldap_password_provider-1.tar.gz
.
File metadata
- Download URL: synapse_ldap_password_provider-1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6002918900d37323f0e4e99e4c68f8f9eaf87a15fe2bfd75385e678ebe9ef26a |
|
MD5 | a9829c6c3dc4082c5af69aeb00eafbf0 |
|
BLAKE2b-256 | 1473a48fc78fa43330f960f85a46a483d86d517bf9949c71f6cebfd937f9f131 |