ChatGPT-Next-Web icon indicating copy to clipboard operation
ChatGPT-Next-Web copied to clipboard

[Bug] 使用Nginx LDAP认证做代码,每次访问都得先认证

Open taoistwar opened this issue 5 months ago • 12 comments

Bug Description

目的禁用 CODE 认证,使用Nginx LDAP 的认证。 Nginx LDAP 认证后,会设置 Authorization 为Basic xxx

Steps to Reproduce

  1. 设置Nginx
  2. 发送聊天

Expected Behavior

只需要认证一次,便可以进行各种使用

Screenshots

No response

Deployment Method

  • [X] Docker
  • [ ] Vercel
  • [ ] Server

Desktop OS

No response

Desktop Browser

No response

Desktop Browser Version

No response

Smartphone Device

No response

Smartphone OS

No response

Smartphone Browser

No response

Smartphone Browser Version

No response

Additional Logs

No response

taoistwar avatar Mar 14 '24 04:03 taoistwar

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] When using Nginx LDAP authentication to code, each access must be authenticated first

Issues-translate-bot avatar Mar 14 '24 04:03 Issues-translate-bot

同样的问题,1.9.9的时候可以,升级到2.11.3 每次都要认证且无法使用

skyma3 avatar Mar 14 '24 07:03 skyma3

Bot detected the issue body's language is not English, translate it automatically.


The same problem, it works in 1.9.9, but when upgraded to 2.11.3, it needs to be authenticated every time and cannot be used.

Issues-translate-bot avatar Mar 14 '24 07:03 Issues-translate-bot

Are you referring to your current LDAP setup will modify the Authorization header to cause NextChat to not work properly?

fred-bf avatar Mar 15 '24 07:03 fred-bf

Are you referring to your current LDAP setup will modify the Authorization header to cause NextChat to not work properly?

我目前还不确定是什么原因导致的,已经回退版本到1.9.9了,感觉像是NextChat把nginx-ldap的cookie给覆盖了一样

skyma3 avatar Mar 15 '24 09:03 skyma3

可以用htpasswd

zbzzh avatar Mar 17 '24 08:03 zbzzh

Bot detected the issue body's language is not English, translate it automatically.


You can use htpasswd

Issues-translate-bot avatar Mar 17 '24 08:03 Issues-translate-bot

问题已经找到了,但是不知道该如何解决 原因是1.9.9版本的access_code是存在请求头的Access-Code中的,而现在的新版本是直接存在了默认的请求头Authorization中,而Authorization是basic_auth的默认key,导致我们使用ldap也好还是basic_auth也好,都会有冲突。

skyma3 avatar Mar 21 '24 10:03 skyma3

Bot detected the issue body's language is not English, translate it automatically.


The problem has been found, but I don’t know how to solve it The reason is that the access_code of version 1.9.9 exists in the Access-Code of the request header, and the new version now directly exists in the default request header Authorization, and Authorization is the default key of basic_auth, which leads us to use ldap or not. Whether it's basic_auth or not, there will be conflicts.

Issues-translate-bot avatar Mar 21 '24 10:03 Issues-translate-bot

Authentication via LDAP is a common requirement, and we will investigate possible solutions (e.g. switching to an http header) later.

fred-bf avatar Mar 21 '24 11:03 fred-bf

Authentication via LDAP is a common requirement, and we will investigate possible solutions (e.g. switching to an http header) later.

期待能在新版本解决该问题 ^_^,因为1.9.9版本无法使用gpt-4.

skyma3 avatar Apr 07 '24 03:04 skyma3

Authentication via LDAP is a common requirement, and we will investigate possible solutions (e.g. switching to an http header) later.

Has this issue been fixed? Or do you have a plan to make it happen? ^_^

skyma3 avatar May 10 '24 02:05 skyma3