mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-08-03 21:54:09 -04:00
Support "identifier" dicts in UIA (#8848)
The spec requires synapse to support `identifier` dicts for `m.login.password` user-interactive auth, which it did not (instead, it required an undocumented `user` parameter.) To fix this properly, we need to pull the code that interprets `identifier` into `AuthHandler.validate_login` so that it can be called from the UIA code. Fixes #5665.
This commit is contained in:
parent
9edff901d1
commit
4d9496559d
5 changed files with 191 additions and 148 deletions
|
@ -358,9 +358,6 @@ class PasswordAuthProviderTests(unittest.HomeserverTestCase):
|
|||
"auth": {
|
||||
"type": "test.login_type",
|
||||
"identifier": {"type": "m.id.user", "user": "localuser"},
|
||||
# FIXME "identifier" is ignored
|
||||
# https://github.com/matrix-org/synapse/issues/5665
|
||||
"user": "localuser",
|
||||
"session": session,
|
||||
},
|
||||
}
|
||||
|
@ -489,9 +486,6 @@ class PasswordAuthProviderTests(unittest.HomeserverTestCase):
|
|||
"auth": {
|
||||
"type": "m.login.password",
|
||||
"identifier": {"type": "m.id.user", "user": "localuser"},
|
||||
# FIXME "identifier" is ignored
|
||||
# https://github.com/matrix-org/synapse/issues/5665
|
||||
"user": "localuser",
|
||||
"password": "localpass",
|
||||
"session": session,
|
||||
},
|
||||
|
@ -541,7 +535,7 @@ class PasswordAuthProviderTests(unittest.HomeserverTestCase):
|
|||
return self._send_login(type="m.login.password", user=user, password=password)
|
||||
|
||||
def _send_login(self, type, user, **params) -> FakeChannel:
|
||||
params.update({"user": user, "type": type})
|
||||
params.update({"identifier": {"type": "m.id.user", "user": user}, "type": type})
|
||||
_, channel = self.make_request("POST", "/_matrix/client/r0/login", params)
|
||||
return channel
|
||||
|
||||
|
@ -569,9 +563,6 @@ class PasswordAuthProviderTests(unittest.HomeserverTestCase):
|
|||
"auth": {
|
||||
"type": "m.login.password",
|
||||
"identifier": {"type": "m.id.user", "user": user_id},
|
||||
# FIXME "identifier" is ignored
|
||||
# https://github.com/matrix-org/synapse/issues/5665
|
||||
"user": user_id,
|
||||
"password": password,
|
||||
"session": session,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue