set IssueInstant and ResponseID on saml error
This commit is contained in:
parent
871baaac87
commit
5ebc5169c3
2 changed files with 10 additions and 2 deletions
|
@ -68,3 +68,6 @@ def gen_pgtiou():
|
|||
"""Generate a Proxy Granting Ticket IOU"""
|
||||
return _gen_ticket('PGTIOU')
|
||||
|
||||
|
||||
def gen_saml_id():
|
||||
return _gen_ticket('_')
|
||||
|
|
|
@ -403,7 +403,12 @@ def _saml_validate_error(request, code, msg=""):
|
|||
return render(
|
||||
request,
|
||||
"cas_server/samlValidateError.xml",
|
||||
{'code':code, 'msg':msg},
|
||||
{
|
||||
'code':code,
|
||||
'msg':msg,
|
||||
'IssueInstant':timezone.now().isoformat(),
|
||||
'ResponseID':utils.gen_saml_id()
|
||||
},
|
||||
content_type="text/xml; charset=utf-8"
|
||||
)
|
||||
|
||||
|
@ -457,7 +462,7 @@ def saml_validate(request):
|
|||
'IssueInstant':issue_instant,
|
||||
'expireInstant':expire_instant,
|
||||
'Recipient':target,
|
||||
'ResponseID':request_id,
|
||||
'ResponseID':utils.gen_saml_id(),
|
||||
'username':ticket.user.username,
|
||||
'attributes':attributes
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue