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
|
Routes for CAS authentication
|
||||||
Modified for ScoDoc
|
Modified for ScoDoc
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import ssl
|
import ssl
|
||||||
from urllib.error import URLError
|
from urllib.error import URLError
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
from xml.parsers.expat import ExpatError
|
||||||
|
|
||||||
import flask
|
import flask
|
||||||
from flask import current_app, request
|
from flask import current_app, request
|
||||||
@ -170,8 +172,8 @@ def validate(ticket):
|
|||||||
if "cas:authenticationSuccess" in xml_from_dict["cas:serviceResponse"]
|
if "cas:authenticationSuccess" in xml_from_dict["cas:serviceResponse"]
|
||||||
else False
|
else False
|
||||||
)
|
)
|
||||||
except ValueError:
|
except (ValueError, ExpatError) as exc:
|
||||||
current_app.logger.error("CAS returned unexpected result")
|
current_app.logger.error(f"CAS returned unexpected result: {exc}")
|
||||||
if cas_error_callback:
|
if cas_error_callback:
|
||||||
cas_error_callback("réponse invalide du serveur CAS")
|
cas_error_callback("réponse invalide du serveur CAS")
|
||||||
except URLError:
|
except URLError:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
"Infos sur version ScoDoc"
|
"Infos sur version ScoDoc"
|
||||||
|
|
||||||
SCOVERSION = "9.7.52"
|
SCOVERSION = "9.7.53"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user