Django用户注销远程身份验证 [英] Django user logout with remote authentication

查看:132
本文介绍了Django用户注销远程身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Kerberos远程认证的网站。我根据Django文档设置了所有内容( https:// docs.djangoproject.com/en/dev/howto/auth-remote-user/ )。登录工作很棒,但是注销不会结束会话。我可以做些什么来确保用户完全注销?关闭浏览器窗口完全看起来好像有效,但是用户需要能够在不关闭浏览器窗口的情况下注销。

解决方案

使用 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆