什么是授权标头?它是如何使用的。与使用登录自定义编码有何不同

发布于 2024-09-29 09:54:30 字数 115 浏览 1 评论 0原文

刚刚发现有一个请求头授权。想知道这个头有什么用。在jsp tomcat servlet环境下是如何使用的。它与普通的登录模块有何不同,普通的登录模块是用户在简单的 jsp 页面中输入用户名密码。页面如何传递授权标头。

Just found that there is a request header authorization. Want to know what is the use of this header. How is it used in the context of jsp tomcat servlet enviornment. How is it different from a normal login module, where user enters username password in a simple jsp page. How a page passes authorization header.

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

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

发布评论

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

评论(1

横笛休吹塞上声 2024-10-06 09:54:30

这是HTTP 基本身份验证的一部分。这是最基本的身份验证方式。当您进入此类网站时,您将看到一个 90 年代风格的登录弹出窗口(看起来像 Javascript 警报),您可以在其中输入凭据。对于 Java EE servlet 容器,您可以通过容器管理的安全性来管理登录和角色。 Java EE 教程中也对此进行了描述,从 < 章节开始em>定义安全要求

不用说,基于表单的身份验证为您提供了更多的设计自由度。您只需使用

创建一个美观的 HTML 页面,然后将其提交给 j_security_check。同一个教程中也对此进行了描述。

This is part of HTTP Basic authentication. This is the most basic way of authentication. When you enter such a website, you will be provided a 90's-style login popup (which look like a Javascript alert) where you can enter the credentials. In case of a Java EE servletcontainer, you can manage the logins and roles by container managed security. This is described in Java EE tutorial as well, starting in the chapter Defining Security Requirements.

Needless to say that Form based authentication provides you more design freedom. You can just create a nice-looking HTML page with a <form> and let it submit to j_security_check. This is described in the same tutorial as well.

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