Skip to content

Commit b175d0e

Browse files
rohec00kiemon5ter
authored andcommitted
More changes as a result of Ali Haider's testing.
1 parent f0f38af commit b175d0e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/satosa/backends/idpy_oidc.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44
import logging
55
from datetime import datetime
6+
from urllib.parse import urlparse
67

78
from idpyoidc.client.oauth2.stand_alone_client import StandAloneClient
89
from idpyoidc.server.user_authn.authn_context import UNSPECIFIED
@@ -12,6 +13,7 @@
1213
from satosa.internal import AuthenticationInformation
1314
from satosa.internal import InternalData
1415
from ..exception import SATOSAAuthenticationError
16+
from ..exception import SATOSAError
1517
from ..response import Redirect
1618

1719
logger = logging.getLogger(__name__)
@@ -67,7 +69,13 @@ def register_endpoints(self):
6769
:rtype: Sequence[(str, Callable[[satosa.context.Context], satosa.response.Response]]
6870
:return: A list that can be used to map the request to SATOSA to this endpoint.
6971
"""
70-
return self.client.context.claims.get_usage('redirect_uris')
72+
url_map = []
73+
redirect_path = self.client.context.claims.get_usage('redirect_uris')
74+
if not redirect_path:
75+
raise SATOSAError("Missing path in redirect uri")
76+
redirect_path = urlparse(redirect_path[0]).path
77+
url_map.append(("^%s$" % redirect_path.lstrip("/"), self.response_endpoint))
78+
return url_map
7179

7280
def response_endpoint(self, context, *args):
7381
"""

0 commit comments

Comments
 (0)