mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-13 12:40:39 -05:00
Merge branch 'social_login_hotfixes' into develop
This commit is contained in:
commit
3f534d3fdf
25 changed files with 379 additions and 141 deletions
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
import time
|
||||
import urllib.parse
|
||||
from typing import Any, Dict, Union
|
||||
from typing import Any, Dict, List, Union
|
||||
from urllib.parse import urlencode
|
||||
|
||||
from mock import Mock
|
||||
|
|
@ -493,13 +493,21 @@ class MultiSSOTestCase(unittest.HomeserverTestCase):
|
|||
self.assertEqual(channel.code, 200, channel.result)
|
||||
|
||||
# parse the form to check it has fields assumed elsewhere in this class
|
||||
html = channel.result["body"].decode("utf-8")
|
||||
p = TestHtmlParser()
|
||||
p.feed(channel.result["body"].decode("utf-8"))
|
||||
p.feed(html)
|
||||
p.close()
|
||||
|
||||
self.assertCountEqual(p.radios["idp"], ["cas", "oidc", "oidc-idp1", "saml"])
|
||||
# there should be a link for each href
|
||||
returned_idps = [] # type: List[str]
|
||||
for link in p.links:
|
||||
path, query = link.split("?", 1)
|
||||
self.assertEqual(path, "pick_idp")
|
||||
params = urllib.parse.parse_qs(query)
|
||||
self.assertEqual(params["redirectUrl"], [TEST_CLIENT_REDIRECT_URL])
|
||||
returned_idps.append(params["idp"][0])
|
||||
|
||||
self.assertEqual(p.hiddens["redirectUrl"], TEST_CLIENT_REDIRECT_URL)
|
||||
self.assertCountEqual(returned_idps, ["cas", "oidc", "oidc-idp1", "saml"])
|
||||
|
||||
def test_multi_sso_redirect_to_cas(self):
|
||||
"""If CAS is chosen, should redirect to the CAS server"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue