Skip to content

Commit 07dccfc

Browse files
committed
fix #280: better using pysaml2 SPConfig loader instead of global django settings!
1 parent 3f49c1e commit 07dccfc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

djangosaml2/views.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,14 +240,14 @@ def get(self, request, *args, **kwargs):
240240

241241
# SSO options
242242
sign_requests = getattr(conf, '_sp_authn_requests_signed', False)
243-
244243
if sign_requests:
245-
csc = settings.SAML_CONFIG['service']['sp']
246-
sso_kwargs["sigalg"] = csc.get('signing_algorithm',
247-
saml2.xmldsig.SIG_RSA_SHA256)
248-
sso_kwargs["digest_alg"] = csc.get('digest_algorithm',
249-
saml2.xmldsig.DIGEST_SHA256)
250-
244+
sso_kwargs["sigalg"] = getattr(conf, '_sp_signing_algorithm',
245+
saml2.xmldsig.SIG_RSA_SHA256
246+
)
247+
sso_kwargs["digest_alg"] = getattr(conf,
248+
'_sp_digest_algorithm',
249+
saml2.xmldsig.DIGEST_SHA256
250+
)
251251
# pysaml needs a string otherwise: "cannot serialize True (type bool)"
252252
if getattr(conf, '_sp_force_authn', False):
253253
sso_kwargs['force_authn'] = "true"

0 commit comments

Comments
 (0)