Skip to content

Commit 04850ee

Browse files
committed
Deprecate saml2 frontend sign_alg and digest_alg configuration options
sign_alg and digest_alg are deprecated; instead, use signing_algorithm and digest_algorithm configurations under the service/idp configuration path (not under policy/default) Signed-off-by: Ivan Kanakarakis <[email protected]>
1 parent 9cbd8d0 commit 04850ee

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

src/satosa/frontends/saml2.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,18 +377,18 @@ def _handle_authn_response(self, context, internal_response, idp):
377377
# Construct arguments for method create_authn_response
378378
# on IdP Server instance
379379
args = {
380-
'identity' : ava,
381-
'name_id' : name_id,
382-
'authn' : auth_info,
383-
'sign_response' : sign_response,
380+
# Add the SP details
381+
**resp_args,
382+
# AuthnResponse data
383+
'identity': ava,
384+
'name_id': name_id,
385+
'authn': auth_info,
386+
'sign_response': sign_response,
384387
'sign_assertion': sign_assertion,
385388
'encrypt_assertion': encrypt_assertion,
386-
'encrypted_advice_attributes': encrypted_advice_attributes
389+
'encrypted_advice_attributes': encrypted_advice_attributes,
387390
}
388391

389-
# Add the SP details
390-
args.update(**resp_args)
391-
392392
try:
393393
args['sign_alg'] = getattr(xmldsig, sign_alg)
394394
except AttributeError as e:
@@ -413,6 +413,16 @@ def _handle_authn_response(self, context, internal_response, idp):
413413
logline = lu.LOG_FMT.format(id=lu.get_session_id(context.state), message=msg)
414414
logger.debug(logline)
415415

416+
if 'sign_alg' in args or 'digest_alg' in args:
417+
msg = (
418+
"sign_alg and digest_alg are deprecated; "
419+
"instead, use signing_algorithm and digest_algorithm "
420+
"under the service/idp configuration path "
421+
"(not under policy/default)."
422+
)
423+
logline = lu.LOG_FMT.format(id=lu.get_session_id(context.state), message=msg)
424+
logger.warning(msg)
425+
416426
resp = idp.create_authn_response(**args)
417427
http_args = idp.apply_binding(
418428
resp_args["binding"], str(resp), resp_args["destination"],

0 commit comments

Comments
 (0)