Whitelist the login fallback by default for SSO

This commit is contained in:
Brendan Abolivier 2020-03-26 18:58:58 +01:00
parent 88bb6c27e1
commit c2ab0b3066
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD
2 changed files with 28 additions and 2 deletions

View file

@ -350,7 +350,18 @@ class CASRedirectConfirmTestCase(unittest.HomeserverTestCase):
def test_cas_redirect_whitelisted(self):
"""Tests that the SSO login flow serves a redirect to a whitelisted url
"""
redirect_url = "https://legit-site.com/"
self._test_redirect("https://legit-site.com/")
@override_config(
{
"public_baseurl": "https://example.com"
}
)
def test_cas_redirect_login_fallback(self):
self._test_redirect("https://example.com/_matrix/static/client/login")
def _test_redirect(self, redirect_url):
"""Tests that the SSO login flow serves a redirect for the given redirect URL."""
cas_ticket_url = (
"/_matrix/client/r0/login/cas/ticket?redirectUrl=%s&ticket=ticket"
% (urllib.parse.quote(redirect_url))