fangli / django-saml2-auth

Django SAML2 Authentication Made Easy. Easily integrate with SAML2 SSO identity providers like Okta
Other
501 stars 222 forks source link

Pysaml2 Version #119

Open hooman96 opened 4 years ago

hooman96 commented 4 years ago

https://github.com/IdentityPython/pysaml2/blob/master/CHANGELOG.md

which version of pysaml2 is compatible with this project?

I currently get the following error after setting up required metadata on domain/login: METADATA_LOCAL_FILE_PATH and METADATA_AUTO_CONF_URL

<Internal Server Error: /admin/login/
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/saml2/client_base.py", line 181, in _sso_location
    srvs = self.metadata.single_sign_on_service(list(eids.keys())[0],
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/site-packages/django_saml2_auth/views.py", line 243, in signin
    _, info = saml_client.prepare_for_authenticate()
  File "/usr/local/lib/python3.7/site-packages/saml2/client.py", line 76, in prepare_for_authenticate
    **kwargs)
  File "/usr/local/lib/python3.7/site-packages/saml2/client.py", line 110, in prepare_for_negotiated_authenticate
    destination = self._sso_location(entityid, binding)
  File "/usr/local/lib/python3.7/site-packages/saml2/client_base.py", line 185, in _sso_location
    raise IdpUnspecified("No IdP to send to given the premises")
saml2.client_base.IdpUnspecified: No IdP to send to given the premises>
ghost commented 4 years ago

@hooman96 Check if metadata is correctly formed, specially the IDPSSODescriptor

hooman96 commented 4 years ago

@akshit-wwstay do you mean in SAML xml file? or SAML2_AUTH in django?

ghost commented 4 years ago

@hooman96 Saml XML file.