跨浏览器Windows表单注销?

发布于 2024-08-01 22:23:16 字数 44 浏览 2 评论 0原文

寻找一种跨浏览器的方式来使用户从使用 Windows 身份验证的网页注销。

Looking for a cross-browser way to log a user off a webpage which uses windows authentication.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

谎言月老 2024-08-08 22:23:16

关闭浏览器是我发现的唯一跨浏览器的方法。 这是我们不得不改用表单身份验证的原因之一。

Closing the browser is the only cross browser way I've found to do that. This is one of the reasons that we had to switch to using Forms authentication.

弃爱 2024-08-08 22:23:16

注销用户有什么意义? 您是否希望他们必须关闭浏览器并再次访问该网站并自动登录?

如果这只是纯粹的视觉假象,那么我会使用 cookie 来指示用户是否需要显示登录屏幕。 它与身份验证或授权无关,只是纯粹指示它们是否“登录”。

当他们注销并进入登录屏幕时会发生什么? 您是否希望他们当时必须输入凭据? “注销后登录”用户故事是什么?

What is the point of logging the user out? Do you want them to have to close the browser and go to the site again and be automatically logged in?

If it is just a purely visual fake out, then I would use a cookie to indicate if the user needs to be shown the login screen or not. It would have nothing to do with Authentication or Authorization, just purely an indicator of if they are "logged in".

What happens when they are logged off and go to the login screen? Do you want them to actually have to enter their credentials at that point? What is the "Log in after Log out" user story?

百思不得你姐 2024-08-08 22:23:16

没有最终的解决方案。 这是所有类型的 www 身份验证的已知限制。

您可以发送虚假的未经授权的答案来再次请求密码。 这种方法可以帮助您模拟注销。

Response.Status = "401 Unauthorized"
Response.AddHeader "WWW-Authenticate", "Negotiate"
Response.AddHeader "WWW-Authenticate", "NTLM"

There is not an ultimate solution. This is a known limitation of all types of www authentications.

You can send a fake unauthorized answer to request password again. This approach may help you to simulate logoff.

Response.Status = "401 Unauthorized"
Response.AddHeader "WWW-Authenticate", "Negotiate"
Response.AddHeader "WWW-Authenticate", "NTLM"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文