|
38 | 38 | StatusNoAuthnContext, StatusRequestDenied,
|
39 | 39 | UnsolicitedResponse)
|
40 | 40 | from saml2.s_utils import UnsupportedBinding
|
| 41 | +from saml2.response import ( |
| 42 | + StatusError, StatusAuthnFailed, SignatureError, StatusRequestDenied, |
| 43 | + UnsolicitedResponse, StatusNoAuthnContext, |
| 44 | +) |
| 45 | +from saml2.mdstore import SourceNotFound |
41 | 46 | from saml2.sigver import MissingKey
|
42 | 47 | from saml2.validate import ResponseLifetimeExceed, ToEarly
|
43 | 48 | from saml2.xmldsig import ( # support for SHA1 is required by spec
|
@@ -124,7 +129,15 @@ def login(request,
|
124 | 129 | })
|
125 | 130 |
|
126 | 131 | selected_idp = request.GET.get('idp', None)
|
127 |
| - conf = get_config(config_loader_path, request) |
| 132 | + try: |
| 133 | + conf = get_config(config_loader_path, request) |
| 134 | + except SourceNotFound as excp: |
| 135 | + msg = ('Error, IdP EntityID was not found ' |
| 136 | + 'in metadata: {}') |
| 137 | + logger.exception(msg.format(excp)) |
| 138 | + return HttpResponse(msg.format(('Please contact ' |
| 139 | + 'technical support.')), |
| 140 | + status=500) |
128 | 141 |
|
129 | 142 | kwargs = {}
|
130 | 143 | # pysaml needs a string otherwise: "cannot serialize True (type bool)"
|
|
0 commit comments