[GH-ISSUE #3106] [Feature Request] 是否有类似basic auth的方式让第三方程序访问服务时候进行授权? #2490

Closed
opened 2026-05-05 13:36:02 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @tonyho on GitHub (Sep 23, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3106

Describe the feature request

我们在内网服务器A 上面有一个网页服务假设端口8080,然后通过一个公网服务器B安装的frps暴露A的8080端口为9090, 其他第三方程序会通过post请求来访问服务器的9090,但是我们期望可以添加一些auth措施,让只有知道这个auth的第三方程序才能通过post交互到我们的服务,我看了下ReadMe里面的"Require HTTP Basic Auth (Password) for Web Services",  这个是使用浏览器才能使用的,有类似的auth方法,让程序也需要通过一个auth才能访问我们的服务吗? 还是说这个basic auth本身就可以的,但是我不知道.

例如时候有类似这样子的方法:
原来打开的方法是: http://b.server.ip:9090
添加了auth后: http://b.server.ip:9090/token=xxxxxxx

谢谢.

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @tonyho on GitHub (Sep 23, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3106 ### Describe the feature request 我们在内网服务器A 上面有一个网页服务假设端口8080,然后通过一个公网服务器B安装的frps暴露A的8080端口为9090, 其他第三方程序会通过post请求来访问服务器的9090,但是我们期望可以添加一些auth措施,让只有知道这个auth的第三方程序才能通过post交互到我们的服务,我看了下ReadMe里面的"Require HTTP Basic Auth (Password) for Web Services",  这个是使用浏览器才能使用的,有类似的auth方法,让程序也需要通过一个auth才能访问我们的服务吗? 还是说这个basic auth本身就可以的,但是我不知道. 例如时候有类似这样子的方法: 原来打开的方法是: http://b.server.ip:9090 添加了auth后: http://b.server.ip:9090/token=xxxxxxx 谢谢. ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [X] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@Becods commented on GitHub (Sep 23, 2022):

http://username:password@example.com/

应该适用于 FireFox、Chrome、Safari

或者你也可以

将用户名和密码拼接为用户:密码形式的字符串 ,编码为base64,拼接Basic ,放入Authorization头字段

示例:

用户名:Aladdin
密码:OpenSesame
拼接后为 Aladdin:OpenSesame
编码后 QWxhZGRpbjpPcGVuU2VzYW1l
在HTTP头部里会是这样:Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

参考 Basic access authentication

<!-- gh-comment-id:1256078008 --> @Becods commented on GitHub (Sep 23, 2022): ``` http://username:password@example.com/ ``` 应该适用于 FireFox、Chrome、Safari 或者你也可以 将用户名和密码拼接为`用户:密码`形式的字符串 ,编码为base64,拼接Basic ,放入Authorization头字段 示例: > 用户名:`Aladdin` > 密码:`OpenSesame` > 拼接后为 `Aladdin:OpenSesame` > 编码后 `QWxhZGRpbjpPcGVuU2VzYW1l` > 在HTTP头部里会是这样:`Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l` 参考 [Basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication)
Author
Owner

@tonyho commented on GitHub (Sep 26, 2022):

http://username:password@example.com/

应该适用于 FireFox、Chrome、Safari

或者你也可以

将用户名和密码拼接为用户:密码形式的字符串 ,编码为base64,拼接Basic ,放入Authorization头字段

示例:

用户名:Aladdin
密码:OpenSesame
拼接后为 Aladdin:OpenSesame
编码后 QWxhZGRpbjpPcGVuU2VzYW1l
在HTTP头部里会是这样:Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

参考 Basic access authentication

Thanks.

<!-- gh-comment-id:1257405129 --> @tonyho commented on GitHub (Sep 26, 2022): > ``` > http://username:password@example.com/ > ``` > > 应该适用于 FireFox、Chrome、Safari > > 或者你也可以 > > 将用户名和密码拼接为`用户:密码`形式的字符串 ,编码为base64,拼接Basic ,放入Authorization头字段 > > 示例: > > > 用户名:`Aladdin` > > 密码:`OpenSesame` > > 拼接后为 `Aladdin:OpenSesame` > > 编码后 `QWxhZGRpbjpPcGVuU2VzYW1l` > > 在HTTP头部里会是这样:`Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l` > > 参考 [Basic access authentication](http://en.wikipedia.org/wiki/Basic_access_authentication) Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2490
No description provided.