mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #1545] web 服务加入 HTTP Basic Auth 认证后, 访问 web 时反复弹出认证界面, 反复填写设置的用户和密码后依然出现 #1221
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#1221
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pointworld on GitHub (Nov 30, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1545
What version of frp are you using (./frpc -v or ./frps -v)?
frps: 0.30.0
frpc: 0.30.0
What operating system and processor architecture are you using (
go env)?frps: CentOS 7.7 64位
frpc: Ubuntu16.04 64位
Configures you used:
frps.ini:
frpc.ini:
Steps to reproduce the issue:
Describe the results you received:
@fatedier commented on GitHub (Dec 1, 2019):
无法复现,测试正常。
@LHANDRH commented on GitHub (Dec 6, 2019):
原因是因为你的frpc.ini配置有错。
frpc.ini 中如果配置了
http_user = abc http_pwd = abc说明你希望frp提供 HTTP Basic Auth (401认证)。
输入 abc/abc 认证只要通过,接下来浏览器的每一次请求都会在请求头头带上base64过的401长哈密码:
Authorization: Basic YWJjOmFiYw==这就是401原理。
这时,你的WEB服务器也启用 HTTP Basic Auth ,但是账号密码不是abc/abc。。浏览器请求头中的认证信息不能被WEB服务器验证通过,因为你配置密码和frpc里设置的不同。。这时服务器响应的内容就是让浏览器再次弹出认证。。你接着输入了服务器的401,又和frpc配置的不一样。。frpc又让你输入。。。就是这样,一直死循环。。。。
@LHANDRH commented on GitHub (Dec 6, 2019):
他一定是不能理解http_user,http_pwd就是相当于我们帮web服务器开了401。。
要不然,他不会说开了 HTTP Basic Auth 和关了HTTP Basic Auth了。。显然这样的词并没有出现在frp的帮助文档中。。肯定是这么回事..
@pointworld commented on GitHub (Dec 7, 2019):
我的 web 服务自身提供了 JWT 认证, 在 HTTP 请求头中占用了
Authorization: xxx, 再使用 HTTP Basic Auth 认证的话, 就会使得二者冲突. 原本初衷是想给服务再加上一层防护罩, 所以出现了这样的 bug, 自己也没有深究原因, 感谢您的解惑@pointworld commented on GitHub (Dec 7, 2019):
也希望作者能在文档中提到冲突的问题, 避免类似我这样对网络一知半解的其它道友也出现类似的问题