File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33"""
44import logging
55from datetime import datetime
6+ from urllib .parse import urlparse
67
78from idpyoidc .client .oauth2 .stand_alone_client import StandAloneClient
89from idpyoidc .server .user_authn .authn_context import UNSPECIFIED
1213from satosa .internal import AuthenticationInformation
1314from satosa .internal import InternalData
1415from ..exception import SATOSAAuthenticationError
16+ from ..exception import SATOSAError
1517from ..response import Redirect
1618
1719logger = 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 """
You can’t perform that action at this time.
0 commit comments