From 78845a7b9dd146fd18bbdd010ecae3a05620f961 Mon Sep 17 00:00:00 2001 From: Wojciech Bartosiak Date: Wed, 25 Jan 2017 11:02:54 +0100 Subject: [PATCH] fix URI fragment example not working URL `http://localhost:8100/#/auth/callback/` --- oidc_provider/lib/endpoints/authorize.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oidc_provider/lib/endpoints/authorize.py b/oidc_provider/lib/endpoints/authorize.py index 58be181..698d87e 100644 --- a/oidc_provider/lib/endpoints/authorize.py +++ b/oidc_provider/lib/endpoints/authorize.py @@ -112,7 +112,7 @@ class AuthorizeEndpoint(object): def create_response_uri(self): uri = urlsplit(self.params['redirect_uri']) query_params = parse_qs(uri.query) - query_fragment = parse_qs(uri.fragment) + query_fragment = {} try: if self.grant_type in ['authorization_code', 'hybrid']: @@ -177,8 +177,7 @@ class AuthorizeEndpoint(object): logger.debug('[Authorize] Error when trying to create response uri: %s', error) raise AuthorizeError(self.params['redirect_uri'], 'server_error', self.grant_type) - uri = uri._replace(query=urlencode(query_params, doseq=True)) - uri = uri._replace(fragment=urlencode(query_fragment, doseq=True)) + uri = uri._replace(query=urlencode(query_params, doseq=True), fragment=uri.fragment + urlencode(query_fragment, doseq=True)) return urlunsplit(uri)