Skip to content

Commit 99ece2e

Browse files
richvdhphil-flex
authored andcommitted
Revert "Merge pull request matrix-org#7153 from matrix-org/babolivier/sso_whitelist_login_fallback"
This was incorrectly merged to master. This reverts commit 319c41f, reversing changes made to 229eb81.
1 parent b799926 commit 99ece2e

4 files changed

Lines changed: 1 addition & 28 deletions

File tree

changelog.d/7153.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/sample_config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,10 +1392,6 @@ sso:
13921392
# phishing attacks from evil.site. To avoid this, include a slash after the
13931393
# hostname: "https://my.client/".
13941394
#
1395-
# If public_baseurl is set, then the login fallback page (used by clients
1396-
# that don't natively support the required login flows) is whitelisted in
1397-
# addition to any URLs in this list.
1398-
#
13991395
# By default, this list is empty.
14001396
#
14011397
#client_whitelist:

synapse/config/sso.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ def read_config(self, config, **kwargs):
3939

4040
self.sso_client_whitelist = sso_config.get("client_whitelist") or []
4141

42-
# Attempt to also whitelist the server's login fallback, since that fallback sets
43-
# the redirect URL to itself (so it can process the login token then return
44-
# gracefully to the client). This would make it pointless to ask the user for
45-
# confirmation, since the URL the confirmation page would be showing wouldn't be
46-
# the client's.
47-
# public_baseurl is an optional setting, so we only add the fallback's URL to the
48-
# list if it's provided (because we can't figure out what that URL is otherwise).
49-
if self.public_baseurl:
50-
login_fallback_url = self.public_baseurl + "_matrix/static/client/login"
51-
self.sso_client_whitelist.append(login_fallback_url)
52-
5342
def generate_config_section(self, **kwargs):
5443
return """\
5544
# Additional settings to use with single-sign on systems such as SAML2 and CAS.
@@ -65,10 +54,6 @@ def generate_config_section(self, **kwargs):
6554
# phishing attacks from evil.site. To avoid this, include a slash after the
6655
# hostname: "https://my.client/".
6756
#
68-
# If public_baseurl is set, then the login fallback page (used by clients
69-
# that don't natively support the required login flows) is whitelisted in
70-
# addition to any URLs in this list.
71-
#
7257
# By default, this list is empty.
7358
#
7459
#client_whitelist:

tests/rest/client/v1/test_login.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,7 @@ def test_cas_redirect_confirm(self):
350350
def test_cas_redirect_whitelisted(self):
351351
"""Tests that the SSO login flow serves a redirect to a whitelisted url
352352
"""
353-
self._test_redirect("https://legit-site.com/")
354-
355-
@override_config({"public_baseurl": "https://example.com"})
356-
def test_cas_redirect_login_fallback(self):
357-
self._test_redirect("https://example.com/_matrix/static/client/login")
358-
359-
def _test_redirect(self, redirect_url):
360-
"""Tests that the SSO login flow serves a redirect for the given redirect URL."""
353+
redirect_url = "https://legit-site.com/"
361354
cas_ticket_url = (
362355
"/_matrix/client/r0/login/cas/ticket?redirectUrl=%s&ticket=ticket"
363356
% (urllib.parse.quote(redirect_url))

0 commit comments

Comments
 (0)