Always return authenticationDate, longTermAuthenticationRequestTokenUsed and isFromNewLogin attributes
As specified in the CAS response XML schema (see Appendix A). Fix #37 as returned attributes are now never empty.
This commit is contained in:
@ -264,7 +264,9 @@ class DummyCAS(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
template = loader.get_template('cas_server/serviceValidate.xml')
|
||||
context = Context({
|
||||
'username': self.server.username,
|
||||
'attributes': self.server.attributes
|
||||
'attributes': self.server.attributes,
|
||||
'auth_date': timezone.now().replace(microsecond=0).isoformat(),
|
||||
'is_new_login': 'true',
|
||||
})
|
||||
self.wfile.write(return_bytes(template.render(context), "utf8"))
|
||||
else:
|
||||
@ -301,6 +303,8 @@ class DummyCAS(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
'ResponseID': utils.gen_saml_id(),
|
||||
'username': self.server.username,
|
||||
'attributes': self.server.attributes,
|
||||
'auth_date': timezone.now().replace(microsecond=0).isoformat(),
|
||||
'is_new_login': 'true',
|
||||
})
|
||||
self.wfile.write(return_bytes(template.render(context), "utf8"))
|
||||
else:
|
||||
|
Reference in New Issue
Block a user