auth2_ssl/backend: do not clutter saml2_endpoints with authncontext declaration, use authentication backend hook

This commit is contained in:
Benjamin Dauvergne 2014-03-20 17:40:58 +01:00
parent 4789396c1f
commit 386bb66a13
2 changed files with 5 additions and 2 deletions

View File

@ -133,3 +133,8 @@ settings')
user.is_active = True
user.save()
return user
@classmethod
def get_saml2_authn_context(cls):
import lasso
return lasso.SAML2_AUTHN_CONTEXT_X509

View File

@ -250,8 +250,6 @@ def build_assertion(request, login, nid_format='transient', attributes=None):
'authentic2.idp.auth_backends.LogginBackend',
'django_auth_ldap.backend.LDAPBackend'):
authn_context = lasso.SAML2_AUTHN_CONTEXT_PASSWORD
elif backend == 'authentic2.auth2_auth.auth2_ssl.backend.SSLBackend':
authn_context = lasso.SAML2_AUTHN_CONTEXT_X509
else:
backend = load_backend(backend)
if hasattr(backend, 'get_saml2_authn_context'):