Skip to content

Commit

Permalink
fix: build correct CAS service parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Naugrimm committed Mar 11, 2020
1 parent 54dd286 commit 7015bbf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synapse/rest/client/v1/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class CasTicketServlet(RestServlet):
def __init__(self, hs):
super(CasTicketServlet, self).__init__()
self.cas_server_url = hs.config.cas_server_url
self.cas_service_url = hs.config.cas_service_url
self.cas_service_url = hs.config.cas_service_url.encode("ascii") + b"/_matrix/client/r0/login/cas/ticket?redirectUrl="
self.cas_displayname_attribute = hs.config.cas_displayname_attribute
self.cas_required_attributes = hs.config.cas_required_attributes
self._sso_auth_handler = SSOAuthHandler(hs)
Expand All @@ -457,9 +457,10 @@ def __init__(self, hs):
async def on_GET(self, request):
client_redirect_url = parse_string(request, "redirectUrl", required=True)
uri = self.cas_server_url + "/proxyValidate"
service_url = self.cas_service_url + urllib.parse.quote(client_redirect_url, safe='').encode("ascii")
args = {
"ticket": parse_string(request, "ticket", required=True),
"service": self.cas_service_url,
"service": service_url,
}
try:
body = await self._http_client.get_raw(uri, args)
Expand Down

0 comments on commit 7015bbf

Please sign in to comment.