sources/saml: improve error handing of invalid signatures

This commit is contained in:
Jens Langhammer
2020-06-23 21:49:27 +02:00
parent 491e507d49
commit 52f138d402
3 changed files with 7 additions and 2 deletions

View File

@ -6,6 +6,7 @@ from django.utils.decorators import method_decorator
from django.utils.http import urlencode
from django.views import View
from django.views.decorators.csrf import csrf_exempt
from signxml import InvalidSignature
from signxml.util import strip_pem_header
from passbook.lib.views import bad_request_message
@ -71,6 +72,8 @@ class ACSView(View):
processor.parse(request)
except MissingSAMLResponse as exc:
return bad_request_message(request, str(exc))
except InvalidSignature as exc:
return bad_request_message(request, str(exc))
try:
return processor.prepare_flow(request)