-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Added possibilty to disable local password authentication #3485
Conversation
Can one of the admins verify this patch? |
1 similar comment
Can one of the admins verify this patch? |
@matrixbot: test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for this. please also see CONTRIBUTING.rst, particularly regarding the request to sign off your PR.
@@ -680,13 +680,16 @@ def validate_login(self, username, login_submission): | |||
|
|||
if login_type == LoginType.PASSWORD: | |||
known_login_type = True | |||
if not self.hs.config.password_localdb: | |||
raise LoginError(403, "Local DB Authentication Disabled", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd let this fall through to the "unknown login type"/"Invalid password" code below. I don't think "Local DB Authentication Disabled" is a helpful message for users.
In other words, just change line 681 to be:
if login_type == LoginType.PASSWORD and self.hs.config.password_localdb:
@@ -23,13 +23,17 @@ class PasswordConfig(Config): | |||
def read_config(self, config): | |||
password_config = config.get("password_config", {}) | |||
self.password_enabled = password_config.get("enabled", True) | |||
self.password_localdb = password_config.get("localdb", True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we call this password_localdb_enabled
or something slightly more intuitive?
(oh and please can you update your branch from latest |
closing this pending requested changes |
Dear all,
this is a small patch which provides the possibility to
this is useful for e.g.: If someone uses a password_provider (e.g. ldap) and does not want: