+ return _cas2_sucess_response(username)
+
+
+def _cas2_error_response(code):
+ return HttpResponse(u''''<cas:serviceResponse xmlns:cas="http://www.yale.edu/tp/cas">
+ <cas:authenticationFailure code="%(code)s">
+ %(message)s
+ </cas:authenticationFailure>
+ </cas:serviceResponse>''' % {
+ 'code': code,
+ 'message': dict(ERROR_MESSAGES).get(code)
+ }, mimetype='text/xml')
+
+
+def _cas2_sucess_response(username):