Django用户注销远程身份验证 [英] Django user logout with remote authentication
本文介绍了Django用户注销远程身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
使用 HttpResponse 返回状态401。
def logout(request):
return HttpResponse(content,status = 401)
这将从Kerebos登录用户。
信用:我在其他地方看到这个解决方案与基本认证有关。
I have a website that uses remote authentication via Kerberos. I've set everything up according to the Django documentation (https://docs.djangoproject.com/en/dev/howto/auth-remote-user/). Logging in works great, however logging out doesn't end the session. What can I do to ensure the user is fully logged out? Closing the browser window entirely does seem to work, but users need to have the ability to log out without closing the browser window.
解决方案
Use HttpResponse to return status 401.
def logout(request):
return HttpResponse(content, status=401)
This will log the user out from Kerebos.
Credit: I saw this solution elsewhere related to Basic Authentication.
这篇关于Django用户注销远程身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文