Skip to content

Commit

Permalink
Merge pull request #137 from AvesIT/authncontext
Browse files Browse the repository at this point in the history
Handle StatusAuthnContext exception from pysaml
  • Loading branch information
knaperek committed Mar 25, 2019
2 parents 5561d11 + 8253032 commit 6439697
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from saml2.s_utils import UnsupportedBinding
from saml2.response import (
StatusError, StatusAuthnFailed, SignatureError, StatusRequestDenied,
UnsolicitedResponse,
UnsolicitedResponse, StatusNoAuthnContext,
)
from saml2.validate import ResponseLifetimeExceed, ToEarly
from saml2.xmldsig import SIG_RSA_SHA1, SIG_RSA_SHA256 # support for SHA1 is required by spec
Expand Down Expand Up @@ -284,6 +284,9 @@ def assertion_consumer_service(request,
except StatusRequestDenied:
logger.warning("Authentication interrupted at IdP.", exc_info=True)
return fail_acs_response(request)
except StatusNoAuthnContext:
logger.warning("Missing Authentication Context from IdP.", exc_info=True)
return fail_acs_response(request)
except MissingKey:
logger.exception("SAML Identity Provider is not configured correctly: certificate key is missing!")
return fail_acs_response(request)
Expand Down

0 comments on commit 6439697

Please sign in to comment.