forked from ScoDoc/ScoDoc
CAS: améliore traitement erreur si réponse XML invalide
This commit is contained in:
parent
5f5f464eb0
commit
7c6a3503a0
@ -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"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user