Skip to content

Commit

Permalink
fix: redirect on pre authz endpoint with client_id and not url scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed Jul 24, 2023
1 parent d23da57 commit 8a1d4b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pyeudiw/satosa/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ def pre_request_endpoint(self, context, internal_request, **kwargs):

url_params = urlencode(payload, quote_via=quote_plus)

res_url = f'{self.config["authorization"]["url_scheme"]}://authorize?{url_params}'
res_url = f'{self.client_id}?{url_params}'
# or
# res_url = f'{self.config["authorization"]["url_scheme"]}://authorize?{url_params}' ?
if is_smartphone(context.http_headers.get('HTTP_USER_AGENT')):
return Redirect(res_url)

Expand Down
2 changes: 2 additions & 0 deletions pyeudiw/tests/satosa/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ def test_pre_request_endpoint(self, context):

# TODO: assert that's a qrcode
# assert "svg xmlns:svg="http://www.w3.org/2000/" in pre_request_endpoint.message

# TODO test same-device

# TODO
def _test_pre_request_endpoint_mobile(self, context):
Expand Down

0 comments on commit 8a1d4b1

Please sign in to comment.