Skip to content

LobeHub OIDC Error when connecting desktop client to self-hosted instance #9684

@Dumail

Description

@Dumail

📦 Platform

Self hosting Docker

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

1.137.0

💻 Operating System

Ubuntu

🌐 Browser

Chrome

🐛 Bug Description

When connecting the desktop client to a self-hosted instance, a LobeHub OIDC Error occurs. The error information includes:

{ "allow_redirect": true, "name": "SessionNotFound", "error": "invalid_request", "status": 400, "statusCode": 400, "expose": true, "error_description": "authorization request has expired" }
{ "error": "invalid_request", "error_description": "authorization request has expired", "iss": "https://chat.xxx.cn/oidc" }

The following environment variables have been configured in Docker:

- APP_URL: https://chat.xxx.cn
- NEXT_AUTH_SECRET: m...
- NEXT_AUTH_SSO_PROVIDERS: casdoor
- NEXTAUTH_URL: https://chat.xxx.cn/api/auth
- AUTH_CASDOOR_ID: xxx
- AUTH_CASDOOR_SECRET: 51114c396033f71b3393b9b303ca621c2ab3594b
- AUTH_CASDOOR_ISSUER: https://casdoor.xxx.cn/
- CASDOOR_WEBHOOK_SECRET: xxxx
- ENABLE_OIDC: 1
- OIDC_JWKS_KEY: {"keys":[{"d":"Iqk...","dq":"Y0sr...","e":"AQAB...","kty":"RSA","n":"jIdvJw...","p":"wqpk...","q":"uNr8...","qi":"j6Ac3...","use":"sig...","kid":"f70...","alg":"RS256"}]}
- NEXT_PUBLIC_ENABLE_NEXT_AUTH: 1
- LOG_LEVEL: debug

The self-hosted instance output log is as follows:

(Use `node --trace-deprecation ...` to show where the warning was created)
(node:28) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
Warning: Cannot polyfill `Path2D`, rendering may be broken.
Warning: Cannot polyfill `ImageData`, rendering may be broken.
Warning: Cannot polyfill `DOMMatrix`, rendering may be broken.
- /app/node_modules/.pnpm/pdfjs-dist@4.10.38/node_modules/pdfjs-dist/legacy/build/pdf.mjs".
Require stack:
Warning: Cannot load "@napi-rs/canvas" package: "Error: Cannot find module '@napi-rs/canvas'
oidc-provider WARNING: Unsupported runtime. Use Node.js v22.x LTS, or a later LTS release.
 ✓ Ready in 97ms
 ✓ Starting...
   - Network:      http://0.0.0.0:3210
   - Local:        http://localhost:3210
   ▲ Next.js 15.3.5
-------------------------------------
✅ database migration pass.
[Database] Start to migration...
-------------------------------------
🌐 DNS Server: [ '127.0.0.11' ]

Additional information: When using the web interface, login authentication and all other operations work without any issues. The desktop client version is 1.137.0, and the self-hosted instance version is 1.137.0. Authentication uses CasDoor, reverse proxy uses Lucky, and all services are accessible from the public internet. Attempts have been made to switch to older versions, change browsers, and clear cookies.

📷 Recurrence Steps

  1. Click the desktop client connection, and the following appears:
Image
  1. The webpage redirects to the confirmation login interface:
Image
  1. Click confirm login and OIDC Error appears:
Image

🚦 Expected Behavior

No response

📝 Additional Information

No response


This issue was translated by Claude.

Original Content

📦 Platform

Self hosting Docker

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

1.137.0

💻 Operating System

Ubuntu

🌐 Browser

Chrome

🐛 Bug Description

使用客户端与自建实例对接时出现LobeHub OIDC Error。错误信息包括:

{ "allow_redirect": true, "name": "SessionNotFound", "error": "invalid_request", "status": 400, "statusCode": 400, "expose": true, "error_description": "authorization request has expired" }
{ "error": "invalid_request", "error_description": "authorization request has expired", "iss": "https://chat.xxx.cn/oidc" }

Docker已经设置以下相关环境变量:

- APP_URL: https://chat.xxx.cn
- NEXT_AUTH_SECRET: m...
- NEXT_AUTH_SSO_PROVIDERS: casdoor
- NEXTAUTH_URL: https://chat.xxx.cn/api/auth
- AUTH_CASDOOR_ID: xxx
- AUTH_CASDOOR_SECRET: 51114c396033f71b3393b9b303ca621c2ab3594b
- AUTH_CASDOOR_ISSUER: https://casdoor.xxx.cn/
- CASDOOR_WEBHOOK_SECRET: xxxx
- ENABLE_OIDC: 1
- OIDC_JWKS_KEY: {"keys":[{"d":"Iqk...","dq":"Y0sr...","e":"AQAB...","kty":"RSA","n":"jIdvJw...","p":"wqpk...","q":"uNr8...","qi":"j6Ac3...","use":"sig...","kid":"f70...","alg":"RS256"}]}
- NEXT_PUBLIC_ENABLE_NEXT_AUTH: 1
- LOG_LEVEL: debug

自建实例输出日志如下:

(Use `node --trace-deprecation ...` to show where the warning was created)
(node:28) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
Warning: Cannot polyfill `Path2D`, rendering may be broken.
Warning: Cannot polyfill `ImageData`, rendering may be broken.
Warning: Cannot polyfill `DOMMatrix`, rendering may be broken.
- /app/node_modules/.pnpm/pdfjs-dist@4.10.38/node_modules/pdfjs-dist/legacy/build/pdf.mjs".
Require stack:
Warning: Cannot load "@napi-rs/canvas" package: "Error: Cannot find module '@napi-rs/canvas'
^[[31;1moidc-provider WARNING: Unsupported runtime. Use Node.js v22.x LTS, or a later LTS release.^[[0m
 ^[[32m^[[1m✓^[[22m^[[39m Ready in 97ms
 ^[[32m^[[1m✓^[[22m^[[39m Starting...
   - Network:      http://0.0.0.0:3210
   - Local:        http://localhost:3210
   ^[[1m^[[38;2;173;127;168m▲ Next.js 15.3.5^[[39m^[[22m
-------------------------------------
✅ database migration pass.
[Database] Start to migration...
-------------------------------------
🌐 DNS Server: [ ^[[32m'127.0.0.11'^[[39m ]

其他信息:通过web界面进行使用,登陆鉴权等操作均无任何问题。桌面客户端版本为:1.137.0,自建实例版本为1.137.0。鉴权使用CasDoor,反向代理使用Lucky,所有服务均可公网访问。尝试过更换旧版本,更换浏览器,清除Cookie等操作。

📷 Recurrence Steps

  1. 点击桌面客户端连接, 出现:
Image
  1. 网页跳转到确认登录界面:
Image
  1. 点击确认登录出现OIDC Error:
Image

🚦 Expected Behavior

No response

📝 Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions