Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Rewrite LDAP Authentication against ldap3 #843
Conversation
matrixbot
commented
Jun 6, 2016
|
Can one of the admins verify this patch? |
matrixbot
commented
Jun 6, 2016
|
Can one of the admins verify this patch? |
matrixbot
commented
Jun 6, 2016
|
Can one of the admins verify this patch? |
matrixbot
commented
Jun 6, 2016
|
Can one of the admins verify this patch? |
mweinelt
changed the title from
Rewrite LDAP Authentication against ldap3
to
[WIP] Rewrite LDAP Authentication against ldap3
Jun 6, 2016
mweinelt
changed the title from
[WIP] Rewrite LDAP Authentication against ldap3
to
Rewrite LDAP Authentication against ldap3
Jun 6, 2016
erikjohnston
self-assigned this
Jun 10, 2016
|
@matrixbot ok to test |
matrixbot
commented
Jun 10, 2016
|
Can one of the admins verify this patch? |
|
I think the unit tests failure is spurious. There are some PEP8 code style violation: http://matrix.org/jenkins/job/SynapseFlake8Packaging/526/violations/file/synapse/handlers/auth.py/ |
|
Does this depend on any particular version of python-ldap3? In particular, will it work with 0.9 (which is the version packaged for older ubuntu/debians) |
|
Indeed this will break when using the dist-package on Debian Jessie (python3-ldap==0.9.4.2):
This, I believe, is because the package name was changed in 0.9.7.1 2015.01.05:
|
|
erikjohnston
commented on an outdated diff
Jun 13, 2016
| @@ -48,6 +48,9 @@ | ||
| "Jinja2>=2.8": ["Jinja2>=2.8"], | ||
| "bleach>=1.4.2": ["bleach>=1.4.2"], | ||
| }, | ||
| + "ldap": { | ||
| + "ldap3": ["ldap3>=1.0"], |
erikjohnston
Owner
|
erikjohnston
commented on an outdated diff
Jun 13, 2016
| @@ -50,17 +55,16 @@ def __init__(self, hs): | ||
| self.INVALID_TOKEN_HTTP_STATUS = 401 | ||
| self.ldap_enabled = hs.config.ldap_enabled | ||
| - self.ldap_server = hs.config.ldap_server | ||
| - self.ldap_port = hs.config.ldap_port | ||
| - self.ldap_tls = hs.config.ldap_tls | ||
| - self.ldap_search_base = hs.config.ldap_search_base | ||
| - self.ldap_search_property = hs.config.ldap_search_property | ||
| - self.ldap_email_property = hs.config.ldap_email_property | ||
| - self.ldap_full_name_property = hs.config.ldap_full_name_property | ||
| - | ||
| - if self.ldap_enabled is True: | ||
| - import ldap | ||
| - logger.info("Import ldap version: %s", ldap.__version__) | ||
| + if self.ldap_enabled: | ||
| + self.ldap_mode = hs.config.ldap_mode |
erikjohnston
Owner
|
|
@matrixbot retest this please |
erikjohnston
commented on an outdated diff
Jun 13, 2016
| @@ -50,17 +55,16 @@ def __init__(self, hs): | ||
| self.INVALID_TOKEN_HTTP_STATUS = 401 | ||
| self.ldap_enabled = hs.config.ldap_enabled | ||
| - self.ldap_server = hs.config.ldap_server | ||
| - self.ldap_port = hs.config.ldap_port | ||
| - self.ldap_tls = hs.config.ldap_tls | ||
| - self.ldap_search_base = hs.config.ldap_search_base | ||
| - self.ldap_search_property = hs.config.ldap_search_property | ||
| - self.ldap_email_property = hs.config.ldap_email_property | ||
| - self.ldap_full_name_property = hs.config.ldap_full_name_property | ||
| - | ||
| - if self.ldap_enabled is True: | ||
| - import ldap | ||
| - logger.info("Import ldap version: %s", ldap.__version__) | ||
| + if ldap3 and self.ldap_enabled: |
erikjohnston
Owner
|
|
I endorse this message ... erm pull request ;) |
erikjohnston
and 1 other
commented on an outdated diff
Jun 22, 2016
| defer.returnValue(False) | ||
| - import ldap | ||
| + if self.ldap_mode not in ('simple_bind', 'search'): | ||
| + logger.warn('Invalid ldap mode specified: %s', self.ldap_mode) |
erikjohnston
Owner
|
|
There is still a mix of "simple_bind" and "simple" for the modes. Is there a file in Matrix, that holds global constants? |
There is a |
|
But that holds """Contains constants from the specification.""" ... These "simple" and "search" are very much implementation detail. |
|
Probably best in synapse/config/ldap.py |
|
Thanks again for this :) |
erikjohnston
merged commit 9fe8944
into
matrix-org:develop
Jun 22, 2016
matrixbot
commented
Jun 22, 2016
|
Can one of the admins verify this patch? |
mweinelt
deleted the
mweinelt:ldap3-rewrite
branch
Jun 22, 2016
simsasaile
commented
Aug 11, 2016
•
|
Hi @mweinelt, How can I get python-ldap3 >=1.0 on debian jessie?
This is my new synapse ldap-config:
That's the config which worked till synapse v0.17.0:
|
|
Hi. Make sure to uninstall python3-ldap3 via apt. Then run pip install --upgrade ldap3. What issue does synapse report on start? Best regards Martin On 11 August 2016 03:05:06 CEST, simsasaile notifications@github.com wrote:
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet. |
simsasaile
commented
Aug 11, 2016
|
Hi Martin, thanks for the fast reply even quite late in the night! :)
I did add some more infos about my config in the first post, maybe there is something wrong? |
simsasaile
commented
Aug 11, 2016
|
Found one problem in my config:
that's the reason that synapse did not start even with ldap enabled set to false. Unfortunately synapse is still not running with my ldap-config. |
simsasaile
commented
Aug 11, 2016
|
Ok, it's all working now! Added Thanks again for your work and your help! |
alephlg
commented
Oct 10, 2016
|
This patch broke my LDAP authentication. Please help me: what's the news in this ldap auth? |
mweinelt commentedJun 6, 2016
This makes synapse ldap capable without requiring a system dependency.
Offer a
searchmode in addition to the pre-existingsimple_bindmode.Searching requires a valid
bind_dnandbind_passwordwithin the configurationbut allows subtree searches for valid
user_dnSigned-of-by: Martin Weinelt hexa@darmstadt.ccc.de