Skip to content

Commit 15bdafd

Browse files
authored
Merge pull request #8 from skip-pay/remove_optional_auth_context
Remove optional auth context (SAML)
2 parents c3b0291 + 32854a8 commit 15bdafd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

auth_token/contrib/ms_sso/helpers.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ def init_saml_auth(request):
7373
service_provider_settings = {
7474
'strict': True,
7575
'debug': django_settings.DEBUG,
76-
**({'security': {
77-
'allowSingleLabelDomains': True,
78-
}} if getattr(django_settings, "AUTH_TOKEN_TEST", False) else {}),
76+
'security': {
77+
'requestedAuthnContext': False, # do not enforce any particular authentication method
78+
**({'allowSingleLabelDomains': True} if getattr(django_settings, "AUTH_TOKEN_TEST", False) else {}),
79+
},
7980
'sp': {
8081
'entityId': settings.MS_SSO_SAML_ENTITY_ID,
8182
'assertionConsumerService': {

example/dj/apps/app/tests/ms_sso.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ def test_saml_should_prevent_open_redirect_attack(self):
270270
assert_true(response.wsgi_request.user.is_authenticated)
271271

272272
@httpretty.activate
273-
def test_saml_auth_should_be_correclty_initialized(self):
273+
def test_saml_auth_should_be_correctly_initialized(self):
274274
self._register_metadata_url(httpretty)
275275
auth = init_saml_auth(RequestFactory().get('/'))
276276
service_provider_settings = auth._settings._sp
@@ -279,3 +279,5 @@ def test_saml_auth_should_be_correclty_initialized(self):
279279
service_provider_settings['assertionConsumerService']['url'],
280280
'http://testserver/login/mso/saml/callback',
281281
)
282+
security_settings = auth._settings._security
283+
assert_equal(security_settings['requestedAuthnContext'], False)

0 commit comments

Comments
 (0)