大网数据广告活动
网站运营与故障问答

Do most websites not use HTTP authentication header but something else for authentication?

· 52CE 我爱测

https://curl.haxx.se/docs/httpscripting.html says It is worth noting that while this is how HTTP Authentication works, very many web sites will not use this concept when they provide logins etc. Does it mean that most websites do…

问题原文

原帖链接 · Tim · CC BY-SA 4.0

https://curl.haxx.se/docs/httpscripting.html says

It is worth noting that while this is how HTTP Authentication works, very many web sites will not use this concept when they provide logins etc.

Does it mean that most websites don't use HTTP authentication header for authentication?

What do they use instead for authentication?

已采纳解答

原帖链接 · Stephen Ostermiller · CC BY-SA 4.0

Using an authentication header usually pops up a modal dialog box on top of your browser like:

That type of authentication is not very popular. It has several drawbacks:

  • The login box looks ugly. There is no way to customize its look and feel. You are not even able to add your logo to it.
  • The modal dialog boxes can annoy users. They can steal focus or cause other tabs to stop responding. This has been a problem for years and the issues have not been fully addressed in popular modern browsers.
  • There is no mechanism for captcha.
  • There is no mechanism for log out.
  • There is no mechanism for any other authentication factor other than password.
  • There is no way to time limit the authentication credentials.
  • There is no "I forgot my password" functionality.
  • There is no method to invalidate existing sessions from the server side.
  • It doesn't integrate well with JavaScript as there are no APIs for it.
  • When used over HTTP (opposed to HTTPS), the basic authentication mechanism is horribly insecure as it transmits both the user name and password in plain text with each request.

Almost all websites allow you to log in using other mechanisms. The most popular is to request the user name and password in an HTML form, then store the authentication credentials in a cookie. Cookies and forms allow developers overcome all the limitations I outlined above.

Another popular method is to piggyback on a login from another site. You can use the OAuth protocol to allow users to log into your site using Facebook or Google.

The authentication header mechanisms are usually only used for password protecting a web application that doesn't have a login mechanism built in. Basic or Digest authentication can be added using web server configuration without modifying the web app itself. One use case might be to password protect a testing server.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2019-01-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。