Skip to content

Commit 5b5577c

Browse files
committed
Handle ACS errors with invalid timestamp
This fixes issue #23
1 parent 480fb88 commit 5b5577c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

djangosaml2/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ def csrf_exempt(view_func):
4949
from saml2.sigver import MissingKey
5050
from saml2.s_utils import UnsupportedBinding
5151
from saml2.response import StatusError
52+
from saml2.validate import ResponseLifetimeExceed, ToEarly
5253
from saml2.xmldsig import SIG_RSA_SHA1, SIG_RSA_SHA256 # support for SHA1 is required by spec
5354

5455
from djangosaml2.cache import IdentityCache, OutstandingQueriesCache
@@ -258,7 +259,8 @@ def assertion_consumer_service(request,
258259
try:
259260
response = client.parse_authn_request_response(xmlstr, BINDING_HTTP_POST,
260261
outstanding_queries)
261-
except StatusError:
262+
except (StatusError, ResponseLifetimeExceed, ToEarly):
263+
logger.exception('Error processing SAML Assertion')
262264
return render(request, 'djangosaml2/login_error.html', status=403)
263265

264266
except MissingKey:

0 commit comments

Comments
 (0)