File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ def csrf_exempt(view_func):
42
42
from saml2 .client import Saml2Client
43
43
from saml2 .metadata import entity_descriptor
44
44
from saml2 .ident import code , decode
45
+ from saml2 .sigver import MissingKey
45
46
46
47
from djangosaml2 .cache import IdentityCache , OutstandingQueriesCache
47
48
from djangosaml2 .cache import StateCache
@@ -209,9 +210,14 @@ def assertion_consumer_service(request,
209
210
oq_cache = OutstandingQueriesCache (request .session )
210
211
outstanding_queries = oq_cache .outstanding_queries ()
211
212
212
- # process the authentication response
213
- response = client .parse_authn_request_response (xmlstr , BINDING_HTTP_POST ,
214
- outstanding_queries )
213
+ try :
214
+ response = client .parse_authn_request_response (xmlstr , BINDING_HTTP_POST ,
215
+ outstanding_queries )
216
+ except MissingKey :
217
+ logger .error ('MissingKey error in ACS' )
218
+ return HttpResponseForbidden (
219
+ "The Identity Provider is not configured correctly: "
220
+ "the certificate key is missing" )
215
221
if response is None :
216
222
logger .error ('SAML response is None' )
217
223
return HttpResponseBadRequest (
You can’t perform that action at this time.
0 commit comments