Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
StatusNoAuthnContext, StatusRequestDenied,
UnsolicitedResponse)
from saml2.s_utils import UnsupportedBinding
from saml2.response import (
StatusError, StatusAuthnFailed, SignatureError, StatusRequestDenied,
UnsolicitedResponse, StatusNoAuthnContext,
)
from saml2.mdstore import SourceNotFound
from saml2.sigver import MissingKey
from saml2.validate import ResponseLifetimeExceed, ToEarly
from saml2.xmldsig import ( # support for SHA1 is required by spec
Expand Down Expand Up @@ -123,7 +128,15 @@ def login(request,
})

selected_idp = request.GET.get('idp', None)
conf = get_config(config_loader_path, request)
try:
conf = get_config(config_loader_path, request)
except SourceNotFound as excp:
msg = ('Error, IdP EntityID was not found '
'in metadata: {}')
logger.exception(msg.format(excp))
return HttpResponse(msg.format(('Please contact '
'technical support.')),
status=500)

kwargs = {}
# pysaml needs a string otherwise: "cannot serialize True (type bool)"
Expand Down