@@ -50,6 +50,11 @@ def __init__(self, auth_callback_func, internal_attributes, config, base_url, na
50
50
self .client .do_provider_info ()
51
51
self .client .do_client_registration ()
52
52
53
+ _redirect_uris = self .client .context .claims .get_usage ('redirect_uris' )
54
+ if not _redirect_uris :
55
+ raise SATOSAError ("Missing path in redirect uri" )
56
+ self .redirect_path = urlparse (_redirect_uris [0 ]).path
57
+
53
58
def start_auth (self , context , internal_request ):
54
59
"""
55
60
See super class method satosa.backends.base#start_auth
@@ -70,11 +75,7 @@ def register_endpoints(self):
70
75
:return: A list that can be used to map the request to SATOSA to this endpoint.
71
76
"""
72
77
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 ((f"^{ redirect_path .lstrip ('/' )} $" , self .response_endpoint ))
78
+ url_map .append ((f"^{ self .redirect_path .lstrip ('/' )} $" , self .response_endpoint ))
78
79
return url_map
79
80
80
81
def response_endpoint (self , context , * args ):
@@ -120,7 +121,10 @@ def _translate_response(self, response, issuer):
120
121
:param subject_type: public or pairwise according to oidc standard.
121
122
:return: A SATOSA internal response.
122
123
"""
123
- auth_info = AuthenticationInformation (UNSPECIFIED , str (datetime .now ()), issuer )
124
+ timestamp = response ["auth_time" ]
125
+ auth_class_ref = response .get ("amr" , response .get ("acr" , UNSPECIFIED ))
126
+ auth_info = AuthenticationInformation (auth_class_ref , timestamp , issuer )
127
+
124
128
internal_resp = InternalData (auth_info = auth_info )
125
129
internal_resp .attributes = self .converter .to_internal ("openid" , response )
126
130
internal_resp .subject_id = response ["sub" ]
0 commit comments