Skip to content
Snippets Groups Projects
Commit 7c6a3503 authored by Emmanuel Viennet's avatar Emmanuel Viennet
Browse files

CAS: améliore traitement erreur si réponse XML invalide

parent 5f5f464e
Branches
No related tags found
No related merge requests found
......@@ -2,10 +2,12 @@
Routes for CAS authentication
Modified for ScoDoc
"""
import re
import ssl
from urllib.error import URLError
from urllib.request import urlopen
from xml.parsers.expat import ExpatError
import flask
from flask import current_app, request
......@@ -170,8 +172,8 @@ def validate(ticket):
if "cas:authenticationSuccess" in xml_from_dict["cas:serviceResponse"]
else False
)
except ValueError:
current_app.logger.error("CAS returned unexpected result")
except (ValueError, ExpatError) as exc:
current_app.logger.error(f"CAS returned unexpected result: {exc}")
if cas_error_callback:
cas_error_callback("réponse invalide du serveur CAS")
except URLError:
......
......@@ -3,7 +3,7 @@
"Infos sur version ScoDoc"
SCOVERSION = "9.7.52"
SCOVERSION = "9.7.53"
SCONAME = "ScoDoc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment