@lobehub/lobehub 2.0.0-next.332 → 2.0.0-next.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/apps/desktop/src/main/const/dir.ts +3 -0
- package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
- package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
- package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
- package/changelog/v1.json +12 -0
- package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
- package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
- package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
- package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
- package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
- package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
- package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
- package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
- package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
- package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
- package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
- package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
- package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
- package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
- package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
- package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
- package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
- package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
- package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
- package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
- package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
- package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
- package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
- package/docs/development/basic/add-new-image-model.mdx +4 -0
- package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
- package/docs/development/basic/architecture.mdx +4 -0
- package/docs/development/basic/architecture.zh-CN.mdx +4 -0
- package/docs/development/basic/chat-api.mdx +4 -0
- package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
- package/docs/development/basic/comfyui-development.mdx +3 -1
- package/docs/development/basic/contributing-guidelines.mdx +4 -0
- package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
- package/docs/development/basic/feature-development-frontend.mdx +11 -3
- package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
- package/docs/development/basic/feature-development.mdx +14 -5
- package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
- package/docs/development/basic/folder-structure.mdx +7 -0
- package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
- package/docs/development/basic/resources.mdx +4 -0
- package/docs/development/basic/resources.zh-CN.mdx +4 -0
- package/docs/development/basic/setup-development.mdx +4 -0
- package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
- package/docs/development/basic/test.mdx +4 -0
- package/docs/development/basic/test.zh-CN.mdx +4 -0
- package/docs/development/basic/work-with-server-side-database.mdx +5 -5
- package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
- package/docs/development/internationalization/add-new-locale.mdx +4 -0
- package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
- package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
- package/docs/development/others/lighthouse.mdx +4 -0
- package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
- package/docs/development/start.mdx +4 -0
- package/docs/development/start.zh-CN.mdx +4 -0
- package/docs/development/state-management/state-management-intro.mdx +4 -2
- package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
- package/docs/development/state-management/state-management-selectors.mdx +6 -1
- package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
- package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
- package/docs/self-hosting/advanced/analytics.mdx +2 -2
- package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
- package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
- package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
- package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
- package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
- package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
- package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
- package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
- package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
- package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
- package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
- package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
- package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
- package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
- package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
- package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
- package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
- package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
- package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
- package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
- package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
- package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
- package/docs/self-hosting/advanced/auth.mdx +86 -139
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
- package/docs/self-hosting/advanced/desktop.mdx +9 -3
- package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
- package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
- package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
- package/docs/self-hosting/advanced/model-list.mdx +2 -2
- package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
- package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
- package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
- package/docs/self-hosting/advanced/online-search.mdx +4 -6
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
- package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
- package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
- package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
- package/docs/self-hosting/environment-variables/auth.mdx +5 -12
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
- package/docs/self-hosting/environment-variables/basic.mdx +3 -10
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
- package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
- package/docs/self-hosting/environment-variables/s3.mdx +2 -2
- package/docs/self-hosting/environment-variables.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.mdx +2 -3
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
- package/docs/self-hosting/examples/ollama.mdx +3 -2
- package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
- package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
- package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
- package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
- package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
- package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/btpanel.mdx +4 -2
- package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
- package/docs/self-hosting/platform/docker-compose.mdx +3 -3
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
- package/docs/self-hosting/platform/docker.mdx +2 -11
- package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
- package/docs/self-hosting/platform/netlify.mdx +5 -17
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
- package/docs/self-hosting/platform/railway.mdx +3 -7
- package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
- package/docs/self-hosting/platform/repocloud.mdx +3 -7
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/sealos.mdx +2 -7
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
- package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
- package/docs/self-hosting/platform/vercel.mdx +4 -9
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
- package/docs/self-hosting/platform/zeabur.mdx +2 -11
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
- package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
- package/docs/self-hosting/server-database/docker.mdx +9 -24
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
- package/docs/self-hosting/server-database/dokploy.mdx +27 -25
- package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
- package/docs/self-hosting/server-database/netlify.mdx +2 -2
- package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
- package/docs/self-hosting/server-database/railway.mdx +2 -2
- package/docs/self-hosting/server-database/repocloud.mdx +2 -2
- package/docs/self-hosting/server-database/sealos.mdx +2 -2
- package/docs/self-hosting/server-database/vercel.mdx +19 -72
- package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
- package/docs/self-hosting/server-database/zeabur.mdx +2 -2
- package/docs/self-hosting/server-database.mdx +1 -19
- package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
- package/docs/self-hosting/start.mdx +2 -2
- package/docs/self-hosting/start.zh-CN.mdx +2 -2
- package/locales/en-US/desktop-onboarding.json +1 -0
- package/locales/zh-CN/desktop-onboarding.json +1 -0
- package/package.json +2 -2
- package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
- package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
- package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
- package/packages/types/src/serverConfig.ts +0 -1
- package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
- package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
- package/src/envs/app.ts +0 -13
- package/src/locales/default/desktop-onboarding.ts +1 -0
- package/src/server/globalConfig/index.ts +1 -2
- package/src/services/electron/system.ts +4 -0
- package/src/store/serverConfig/selectors.ts +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置 Casdoor 身份验证
|
|
3
|
+
description: 学习如何在 LobeChat 中配置 Casdoor SSO,包括创建应用和设置环境变量。
|
|
4
|
+
tags:
|
|
5
|
+
- Casdoor
|
|
6
|
+
- 身份验证
|
|
7
|
+
- LobeChat
|
|
8
|
+
- 单点登录
|
|
9
|
+
- OIDC
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 配置 Casdoor 身份验证
|
|
13
|
+
|
|
14
|
+
[Casdoor](https://casdoor.org/) 是一个开源的身份访问管理 (IAM) 平台,提供 Web UI 支持单点登录。
|
|
15
|
+
|
|
16
|
+
<Steps>
|
|
17
|
+
### 在 Casdoor 中创建应用
|
|
18
|
+
|
|
19
|
+
1. 登录 Casdoor 管理控制台
|
|
20
|
+
2. 前往 **Applications**,点击 **Add**
|
|
21
|
+
3. 配置应用:
|
|
22
|
+
- Name: `LobeChat`
|
|
23
|
+
- Organization: 选择你的组织
|
|
24
|
+
- Redirect URLs: 添加回调 URL
|
|
25
|
+
|
|
26
|
+
<Callout type={'info'}>
|
|
27
|
+
**回调 URL 格式**: `https://your-domain.com/api/auth/callback/casdoor`
|
|
28
|
+
</Callout>
|
|
29
|
+
|
|
30
|
+
4. 保存并记下 **Client ID** 和 **Client Secret**
|
|
31
|
+
|
|
32
|
+
### 获取 Issuer URL
|
|
33
|
+
|
|
34
|
+
Issuer URL 是 Casdoor 服务器 URL,通常为:`https://your-casdoor-domain`
|
|
35
|
+
|
|
36
|
+
### 配置环境变量
|
|
37
|
+
|
|
38
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
39
|
+
|
|
40
|
+
| 环境变量 | 类型 | 描述 |
|
|
41
|
+
| -------------------------------- | -- | ------------------------------------------------- |
|
|
42
|
+
| `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
|
|
43
|
+
| `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Casdoor 请填写 `casdoor` |
|
|
44
|
+
| `AUTH_CASDOOR_ID` | 必选 | Casdoor 应用的 Client ID |
|
|
45
|
+
| `AUTH_CASDOOR_SECRET` | 必选 | Casdoor 应用的 Client Secret |
|
|
46
|
+
| `AUTH_CASDOOR_ISSUER` | 必选 | Casdoor 服务器 URL(例如 `https://your-casdoor-domain`) |
|
|
47
|
+
|
|
48
|
+
<Callout type={'tip'}>
|
|
49
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#casdoor) 可查阅相关变量详情。
|
|
50
|
+
</Callout>
|
|
51
|
+
</Steps>
|
|
52
|
+
|
|
53
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。</Callout>
|
|
54
|
+
|
|
55
|
+
## 相关资源
|
|
56
|
+
|
|
57
|
+
- [Casdoor 文档](https://casdoor.org/docs/overview)
|
|
58
|
+
- [Casdoor 应用配置](https://casdoor.org/docs/application/config)
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring Cloudflare Zero Trust Authentication for LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to configure Cloudflare Zero Trust SSO for LobeChat, including
|
|
5
|
+
creating an Access application.
|
|
6
|
+
tags:
|
|
7
|
+
- Cloudflare Zero Trust
|
|
8
|
+
- Authentication
|
|
9
|
+
- LobeChat
|
|
10
|
+
- Single Sign-On
|
|
11
|
+
- OIDC
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Configuring Cloudflare Zero Trust Authentication
|
|
15
|
+
|
|
16
|
+
[Cloudflare Zero Trust](https://www.cloudflare.com/zero-trust/) provides secure access to your applications without a VPN.
|
|
17
|
+
|
|
18
|
+
<Steps>
|
|
19
|
+
### Create Access Application
|
|
20
|
+
|
|
21
|
+
1. Log in to [Cloudflare Zero Trust Dashboard](https://one.dash.cloudflare.com/)
|
|
22
|
+
2. Go to **Access** > **Applications**
|
|
23
|
+
3. Click **Add an application** and select **SaaS**
|
|
24
|
+
4. Configure the application:
|
|
25
|
+
- Application name: `LobeChat`
|
|
26
|
+
- Select OIDC as the authentication protocol
|
|
27
|
+
- Add the callback URL in redirect URIs
|
|
28
|
+
|
|
29
|
+
<Callout type={'info'}>
|
|
30
|
+
**Callback URL Format**: `https://your-domain.com/api/auth/callback/cloudflare-zero-trust`
|
|
31
|
+
</Callout>
|
|
32
|
+
|
|
33
|
+
5. Note down the **Client ID**, **Client Secret**, and **Issuer URL**
|
|
34
|
+
|
|
35
|
+
### Configure Environment Variables
|
|
36
|
+
|
|
37
|
+
When deploying LobeChat, you need to configure the following environment variables:
|
|
38
|
+
|
|
39
|
+
| Environment Variable | Type | Description |
|
|
40
|
+
| ----------------------------------- | -------- | ----------------------------------------------------------------------------- |
|
|
41
|
+
| `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
|
|
42
|
+
| `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `cloudflare-zero-trust` |
|
|
43
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | Required | Client ID from Cloudflare Access |
|
|
44
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | Required | Client Secret from Cloudflare Access |
|
|
45
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | Required | Issuer URL (e.g., `https://your-team.cloudflareaccess.com`) |
|
|
46
|
+
|
|
47
|
+
<Callout type={'tip'}>
|
|
48
|
+
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#cloudflare-zero-trust) for detailed information on these variables.
|
|
49
|
+
</Callout>
|
|
50
|
+
</Steps>
|
|
51
|
+
|
|
52
|
+
<Callout type={'info'}>
|
|
53
|
+
After successful deployment, users will be able to authenticate with Cloudflare Zero Trust and use LobeChat.
|
|
54
|
+
</Callout>
|
|
55
|
+
|
|
56
|
+
## Related Resources
|
|
57
|
+
|
|
58
|
+
- [Cloudflare Zero Trust Documentation](https://developers.cloudflare.com/cloudflare-one/)
|
|
59
|
+
- [Configure OIDC Application](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/generic-oidc/)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置 Cloudflare Zero Trust 身份验证
|
|
3
|
+
description: 学习如何在 LobeChat 中配置 Cloudflare Zero Trust SSO,包括创建 Access 应用。
|
|
4
|
+
tags:
|
|
5
|
+
- Cloudflare Zero Trust
|
|
6
|
+
- 身份验证
|
|
7
|
+
- LobeChat
|
|
8
|
+
- 单点登录
|
|
9
|
+
- OIDC
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 配置 Cloudflare Zero Trust 身份验证
|
|
13
|
+
|
|
14
|
+
[Cloudflare Zero Trust](https://www.cloudflare.com/zero-trust/) 无需 VPN 即可提供应用程序的安全访问。
|
|
15
|
+
|
|
16
|
+
<Steps>
|
|
17
|
+
### 创建 Access 应用
|
|
18
|
+
|
|
19
|
+
1. 登录 [Cloudflare Zero Trust Dashboard](https://one.dash.cloudflare.com/)
|
|
20
|
+
2. 前往 **Access** > **Applications**
|
|
21
|
+
3. 点击 **Add an application**,选择 **SaaS**
|
|
22
|
+
4. 配置应用:
|
|
23
|
+
- Application name: `LobeChat`
|
|
24
|
+
- 选择 OIDC 作为认证协议
|
|
25
|
+
- 在 redirect URIs 中添加回调 URL
|
|
26
|
+
|
|
27
|
+
<Callout type={'info'}>
|
|
28
|
+
**回调 URL 格式**: `https://your-domain.com/api/auth/callback/cloudflare-zero-trust`
|
|
29
|
+
</Callout>
|
|
30
|
+
|
|
31
|
+
5. 记下 **Client ID**、**Client Secret** 和 **Issuer URL**
|
|
32
|
+
|
|
33
|
+
### 配置环境变量
|
|
34
|
+
|
|
35
|
+
在部署 LobeChat 时,你需要配置以下环境变量:
|
|
36
|
+
|
|
37
|
+
| 环境变量 | 类型 | 描述 |
|
|
38
|
+
| ----------------------------------- | -- | ------------------------------------------------------- |
|
|
39
|
+
| `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
|
|
40
|
+
| `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。填写 `cloudflare-zero-trust` |
|
|
41
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | Cloudflare Access 的 Client ID |
|
|
42
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | Cloudflare Access 的 Client Secret |
|
|
43
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | Issuer URL(例如 `https://your-team.cloudflareaccess.com`) |
|
|
44
|
+
|
|
45
|
+
<Callout type={'tip'}>
|
|
46
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#cloudflare-zero-trust) 可查阅相关变量详情。
|
|
47
|
+
</Callout>
|
|
48
|
+
</Steps>
|
|
49
|
+
|
|
50
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Cloudflare Zero Trust 身份认证并使用 LobeChat。</Callout>
|
|
51
|
+
|
|
52
|
+
## 相关资源
|
|
53
|
+
|
|
54
|
+
- [Cloudflare Zero Trust 文档](https://developers.cloudflare.com/cloudflare-one/)
|
|
55
|
+
- [配置 OIDC 应用](https://developers.cloudflare.com/cloudflare-one/identity/idp-integration/generic-oidc/)
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring AWS Cognito Authentication for LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to configure AWS Cognito SSO for LobeChat, including creating a User
|
|
5
|
+
Pool and App Client in AWS Console.
|
|
6
|
+
tags:
|
|
7
|
+
- AWS Cognito
|
|
8
|
+
- Authentication
|
|
9
|
+
- LobeChat
|
|
10
|
+
- Single Sign-On
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Configuring AWS Cognito Authentication
|
|
14
|
+
|
|
15
|
+
<Steps>
|
|
16
|
+
### Create a Cognito User Pool
|
|
17
|
+
|
|
18
|
+
1. Go to [AWS Cognito Console](https://console.aws.amazon.com/cognito/)
|
|
19
|
+
2. Click **Create user pool**
|
|
20
|
+
3. Configure sign-in experience:
|
|
21
|
+
- Select **Email** as the sign-in option
|
|
22
|
+
- Configure password policy and MFA settings as needed
|
|
23
|
+
- Configure user account recovery options
|
|
24
|
+
|
|
25
|
+
### Configure App Client
|
|
26
|
+
|
|
27
|
+
In the **App integration** section:
|
|
28
|
+
|
|
29
|
+
1. Click **Add an app client**
|
|
30
|
+
2. Select **Confidential client** as the app type
|
|
31
|
+
3. Enter a name for the app client
|
|
32
|
+
4. Under **OAuth 2.0 grant types**, enable **Authorization code grant**
|
|
33
|
+
5. Under **OpenID Connect scopes**, select `email`, `openid`, and `profile`
|
|
34
|
+
|
|
35
|
+
### Configure Callback URL
|
|
36
|
+
|
|
37
|
+
In the app client settings, add the callback URL:
|
|
38
|
+
|
|
39
|
+
<Callout type={'info'}>
|
|
40
|
+
Callback URL format:
|
|
41
|
+
|
|
42
|
+
- Local development: `http://localhost:3210/api/auth/callback/cognito`
|
|
43
|
+
- Production: `https://your-domain.com/api/auth/callback/cognito`
|
|
44
|
+
</Callout>
|
|
45
|
+
|
|
46
|
+
### Configure Domain
|
|
47
|
+
|
|
48
|
+
1. Go to **App integration** > **Domain**
|
|
49
|
+
2. Configure a Cognito domain (e.g., `your-app-name`) or custom domain
|
|
50
|
+
3. Note your full domain (e.g., `your-app-name.auth.us-east-1.amazoncognito.com`)
|
|
51
|
+
|
|
52
|
+
### Get Configuration Values
|
|
53
|
+
|
|
54
|
+
Collect the following:
|
|
55
|
+
|
|
56
|
+
- **Client ID**: From App client settings
|
|
57
|
+
- **Client Secret**: From App client settings (click "Show client secret")
|
|
58
|
+
- **User Pool ID**: From User pool overview (e.g., `us-east-1_XXXXXXXXX`)
|
|
59
|
+
- **Region**: AWS region (e.g., `us-east-1`)
|
|
60
|
+
- **Domain**: Your Cognito domain
|
|
61
|
+
|
|
62
|
+
### Configure Environment Variables
|
|
63
|
+
|
|
64
|
+
| Environment Variable | Type | Description |
|
|
65
|
+
| -------------------------------- | -------- | ------------------------------------------------------------------ |
|
|
66
|
+
| `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
|
|
67
|
+
| `AUTH_SSO_PROVIDERS` | Required | Set to `cognito` |
|
|
68
|
+
| `AUTH_COGNITO_ID` | Required | App Client ID |
|
|
69
|
+
| `AUTH_COGNITO_SECRET` | Required | App Client Secret |
|
|
70
|
+
| `AUTH_COGNITO_DOMAIN` | Required | Cognito domain (e.g., `your-app.auth.us-east-1.amazoncognito.com`) |
|
|
71
|
+
| `AUTH_COGNITO_REGION` | Required | AWS Region (e.g., `us-east-1`) |
|
|
72
|
+
| `AUTH_COGNITO_USERPOOL_ID` | Required | User Pool ID (e.g., `us-east-1_XXXXXXXXX`) |
|
|
73
|
+
|
|
74
|
+
<Callout type={'tip'}>
|
|
75
|
+
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#cognito)
|
|
76
|
+
for detailed information.
|
|
77
|
+
</Callout>
|
|
78
|
+
</Steps>
|
|
79
|
+
|
|
80
|
+
<Callout type={'info'}>
|
|
81
|
+
After successful deployment, users will be able to authenticate with AWS
|
|
82
|
+
Cognito and use LobeChat.
|
|
83
|
+
</Callout>
|
|
84
|
+
|
|
85
|
+
## Related Resources
|
|
86
|
+
|
|
87
|
+
- [AWS Cognito Console](https://console.aws.amazon.com/cognito/)
|
|
88
|
+
- [Amazon Cognito Documentation](https://docs.aws.amazon.com/cognito/)
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置 AWS Cognito 身份验证
|
|
3
|
+
description: 学习如何在 LobeChat 中配置 AWS Cognito SSO,包括在 AWS Console 创建用户池和应用客户端。
|
|
4
|
+
tags:
|
|
5
|
+
- AWS Cognito
|
|
6
|
+
- 身份验证
|
|
7
|
+
- LobeChat
|
|
8
|
+
- 单点登录
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# 配置 AWS Cognito 身份验证
|
|
12
|
+
|
|
13
|
+
<Steps>
|
|
14
|
+
### 创建 Cognito 用户池
|
|
15
|
+
|
|
16
|
+
1. 前往 [AWS Cognito Console](https://console.aws.amazon.com/cognito/)
|
|
17
|
+
2. 点击 **Create user pool**
|
|
18
|
+
3. 配置登录体验:
|
|
19
|
+
- 选择 **Email** 作为登录选项
|
|
20
|
+
- 根据需要配置密码策略和 MFA 设置
|
|
21
|
+
- 配置用户账户恢复选项
|
|
22
|
+
|
|
23
|
+
### 配置应用客户端
|
|
24
|
+
|
|
25
|
+
在 **App integration** 部分:
|
|
26
|
+
|
|
27
|
+
1. 点击 **Add an app client**
|
|
28
|
+
2. 选择 **Confidential client** 作为应用类型
|
|
29
|
+
3. 输入应用客户端名称
|
|
30
|
+
4. 在 **OAuth 2.0 grant types** 下,启用 **Authorization code grant**
|
|
31
|
+
5. 在 **OpenID Connect scopes** 下,选择 `email`、`openid` 和 `profile`
|
|
32
|
+
|
|
33
|
+
### 配置回调 URL
|
|
34
|
+
|
|
35
|
+
在应用客户端设置中,添加回调 URL:
|
|
36
|
+
|
|
37
|
+
<Callout type={'info'}>
|
|
38
|
+
回调 URL 格式:
|
|
39
|
+
|
|
40
|
+
- 本地开发: `http://localhost:3210/api/auth/callback/cognito`
|
|
41
|
+
- 生产环境: `https://your-domain.com/api/auth/callback/cognito`
|
|
42
|
+
</Callout>
|
|
43
|
+
|
|
44
|
+
### 配置域名
|
|
45
|
+
|
|
46
|
+
1. 前往 **App integration** > **Domain**
|
|
47
|
+
2. 配置 Cognito 域名(如 `your-app-name`)或自定义域名
|
|
48
|
+
3. 记录完整域名(如 `your-app-name.auth.us-east-1.amazoncognito.com`)
|
|
49
|
+
|
|
50
|
+
### 获取配置值
|
|
51
|
+
|
|
52
|
+
收集以下信息:
|
|
53
|
+
|
|
54
|
+
- **Client ID**:来自应用客户端设置
|
|
55
|
+
- **Client Secret**:来自应用客户端设置(点击 "Show client secret")
|
|
56
|
+
- **User Pool ID**:来自用户池概览(如 `us-east-1_XXXXXXXXX`)
|
|
57
|
+
- **Region**:AWS 区域(如 `us-east-1`)
|
|
58
|
+
- **Domain**:你的 Cognito 域名
|
|
59
|
+
|
|
60
|
+
### 配置环境变量
|
|
61
|
+
|
|
62
|
+
| 环境变量 | 类型 | 描述 |
|
|
63
|
+
| -------------------------------- | -- | --------------------------------------------------------- |
|
|
64
|
+
| `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
|
|
65
|
+
| `AUTH_SSO_PROVIDERS` | 必选 | 填写 `cognito` |
|
|
66
|
+
| `AUTH_COGNITO_ID` | 必选 | 应用客户端 ID |
|
|
67
|
+
| `AUTH_COGNITO_SECRET` | 必选 | 应用客户端 Secret |
|
|
68
|
+
| `AUTH_COGNITO_DOMAIN` | 必选 | Cognito 域名(如 `your-app.auth.us-east-1.amazoncognito.com`) |
|
|
69
|
+
| `AUTH_COGNITO_REGION` | 必选 | AWS 区域(如 `us-east-1`) |
|
|
70
|
+
| `AUTH_COGNITO_USERPOOL_ID` | 必选 | 用户池 ID(如 `us-east-1_XXXXXXXXX`) |
|
|
71
|
+
|
|
72
|
+
<Callout type={'tip'}>
|
|
73
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#cognito)
|
|
74
|
+
可查阅相关变量详情。
|
|
75
|
+
</Callout>
|
|
76
|
+
</Steps>
|
|
77
|
+
|
|
78
|
+
<Callout type={'info'}>
|
|
79
|
+
部署成功后,用户将可以通过 AWS Cognito 身份认证并使用 LobeChat。
|
|
80
|
+
</Callout>
|
|
81
|
+
|
|
82
|
+
## 相关资源
|
|
83
|
+
|
|
84
|
+
- [AWS Cognito Console](https://console.aws.amazon.com/cognito/)
|
|
85
|
+
- [Amazon Cognito 文档](https://docs.aws.amazon.com/cognito/)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring Feishu (Lark) Authentication for LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to configure Feishu (Lark) SSO for LobeChat, including creating an
|
|
5
|
+
application and setting up environment variables.
|
|
6
|
+
tags:
|
|
7
|
+
- Feishu
|
|
8
|
+
- Lark
|
|
9
|
+
- Authentication
|
|
10
|
+
- LobeChat
|
|
11
|
+
- Single Sign-On
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Configuring Feishu (Lark) Authentication
|
|
15
|
+
|
|
16
|
+
[Feishu](https://www.feishu.cn/) (also known as Lark internationally) is an enterprise collaboration platform by ByteDance.
|
|
17
|
+
|
|
18
|
+
<Steps>
|
|
19
|
+
### Create Application in Feishu Open Platform
|
|
20
|
+
|
|
21
|
+
1. Go to [Feishu Open Platform](https://open.feishu.cn/)
|
|
22
|
+
2. Click **Create App** > **Enterprise Self-built App**
|
|
23
|
+
3. Fill in the app name and description
|
|
24
|
+
4. After creation, go to **Credentials & Basic Info** to get:
|
|
25
|
+
- **App ID**
|
|
26
|
+
- **App Secret**
|
|
27
|
+
|
|
28
|
+
### Configure OAuth Permissions
|
|
29
|
+
|
|
30
|
+
1. In app settings, go to **Security Settings**
|
|
31
|
+
2. Add the redirect URI
|
|
32
|
+
|
|
33
|
+
<Callout type={'info'}>
|
|
34
|
+
Callback URL format:
|
|
35
|
+
|
|
36
|
+
- Local development: `http://localhost:3210/api/auth/callback/feishu`
|
|
37
|
+
- Production: `https://your-domain.com/api/auth/callback/feishu`
|
|
38
|
+
</Callout>
|
|
39
|
+
|
|
40
|
+
3. Go to **Permissions & Scopes** and add:
|
|
41
|
+
- `contact:user.email:readonly` (read user email)
|
|
42
|
+
- `contact:user.base:readonly` (read basic user info)
|
|
43
|
+
|
|
44
|
+
### Publish the Application
|
|
45
|
+
|
|
46
|
+
1. Go to **Version Management & Release**
|
|
47
|
+
2. Create a new version and submit for review
|
|
48
|
+
3. Once approved, publish the app
|
|
49
|
+
|
|
50
|
+
### Configure Environment Variables
|
|
51
|
+
|
|
52
|
+
| Environment Variable | Type | Description |
|
|
53
|
+
| -------------------------------- | -------- | --------------------------------------------------------------- |
|
|
54
|
+
| `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
|
|
55
|
+
| `AUTH_SSO_PROVIDERS` | Required | Set to `feishu` |
|
|
56
|
+
| `AUTH_FEISHU_APP_ID` | Required | App ID from Feishu Open Platform |
|
|
57
|
+
| `AUTH_FEISHU_APP_SECRET` | Required | App Secret from Feishu Open Platform |
|
|
58
|
+
|
|
59
|
+
<Callout type={'tip'}>
|
|
60
|
+
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#feishu)
|
|
61
|
+
for detailed information.
|
|
62
|
+
</Callout>
|
|
63
|
+
</Steps>
|
|
64
|
+
|
|
65
|
+
<Callout type={'info'}>
|
|
66
|
+
After successful deployment, users will be able to authenticate with Feishu
|
|
67
|
+
and use LobeChat.
|
|
68
|
+
</Callout>
|
|
69
|
+
|
|
70
|
+
## Related Resources
|
|
71
|
+
|
|
72
|
+
- [Feishu Open Platform](https://open.feishu.cn/)
|
|
73
|
+
- [Feishu OAuth 2.0 Guide](https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview)
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置飞书身份验证
|
|
3
|
+
description: 学习如何在 LobeChat 中配置飞书 SSO,包括创建应用和设置环境变量。
|
|
4
|
+
tags:
|
|
5
|
+
- 飞书
|
|
6
|
+
- 身份验证
|
|
7
|
+
- LobeChat
|
|
8
|
+
- 单点登录
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# 配置飞书身份验证
|
|
12
|
+
|
|
13
|
+
[飞书](https://www.feishu.cn/) 是字节跳动推出的企业协作平台。
|
|
14
|
+
|
|
15
|
+
<Steps>
|
|
16
|
+
### 在飞书开放平台创建应用
|
|
17
|
+
|
|
18
|
+
1. 前往 [飞书开放平台](https://open.feishu.cn/)
|
|
19
|
+
2. 点击 **创建应用** > **企业自建应用**
|
|
20
|
+
3. 填写应用名称和描述
|
|
21
|
+
4. 创建后,前往 **凭证与基础信息** 获取:
|
|
22
|
+
- **App ID**
|
|
23
|
+
- **App Secret**
|
|
24
|
+
|
|
25
|
+
### 配置 OAuth 权限
|
|
26
|
+
|
|
27
|
+
1. 在应用设置中,前往 **安全设置**
|
|
28
|
+
2. 添加重定向 URI
|
|
29
|
+
|
|
30
|
+
<Callout type={'info'}>
|
|
31
|
+
回调 URL 格式:
|
|
32
|
+
|
|
33
|
+
- 本地开发: `http://localhost:3210/api/auth/callback/feishu`
|
|
34
|
+
- 生产环境: `https://your-domain.com/api/auth/callback/feishu`
|
|
35
|
+
</Callout>
|
|
36
|
+
|
|
37
|
+
3. 前往 **权限管理** 添加:
|
|
38
|
+
- `contact:user.email:readonly`(读取用户邮箱)
|
|
39
|
+
- `contact:user.base:readonly`(读取用户基本信息)
|
|
40
|
+
|
|
41
|
+
### 发布应用
|
|
42
|
+
|
|
43
|
+
1. 前往 **版本管理与发布**
|
|
44
|
+
2. 创建新版本并提交审核
|
|
45
|
+
3. 审核通过后,发布应用
|
|
46
|
+
|
|
47
|
+
### 配置环境变量
|
|
48
|
+
|
|
49
|
+
| 环境变量 | 类型 | 描述 |
|
|
50
|
+
| -------------------------------- | -- | -------------------------------------- |
|
|
51
|
+
| `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
|
|
52
|
+
| `AUTH_SSO_PROVIDERS` | 必选 | 填写 `feishu` |
|
|
53
|
+
| `AUTH_FEISHU_APP_ID` | 必选 | 飞书开放平台的 App ID |
|
|
54
|
+
| `AUTH_FEISHU_APP_SECRET` | 必选 | 飞书开放平台的 App Secret |
|
|
55
|
+
|
|
56
|
+
<Callout type={'tip'}>
|
|
57
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#feishu)
|
|
58
|
+
可查阅相关变量详情。
|
|
59
|
+
</Callout>
|
|
60
|
+
</Steps>
|
|
61
|
+
|
|
62
|
+
<Callout type={'info'}>
|
|
63
|
+
部署成功后,用户将可以通过飞书身份认证并使用 LobeChat。
|
|
64
|
+
</Callout>
|
|
65
|
+
|
|
66
|
+
## 相关资源
|
|
67
|
+
|
|
68
|
+
- [飞书开放平台](https://open.feishu.cn/)
|
|
69
|
+
- [飞书 OAuth 2.0 指南](https://open.feishu.cn/document/common-capabilities/sso/web-application-sso/web-app-overview)
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Configuring Generic OIDC Authentication for LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to configure any OpenID Connect provider for LobeChat using Generic
|
|
5
|
+
OIDC integration.
|
|
6
|
+
tags:
|
|
7
|
+
- Generic OIDC
|
|
8
|
+
- OpenID Connect
|
|
9
|
+
- Authentication
|
|
10
|
+
- LobeChat
|
|
11
|
+
- Single Sign-On
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Configuring Generic OIDC Authentication
|
|
15
|
+
|
|
16
|
+
Use Generic OIDC to integrate LobeChat with any OpenID Connect compliant identity provider not explicitly listed in our supported providers.
|
|
17
|
+
|
|
18
|
+
<Steps>
|
|
19
|
+
### Configure Your OIDC Provider
|
|
20
|
+
|
|
21
|
+
In your identity provider's admin console:
|
|
22
|
+
|
|
23
|
+
1. Create a new OIDC/OAuth2 application
|
|
24
|
+
2. Set the application type to **Web Application** or **Confidential Client**
|
|
25
|
+
3. Enable required scopes: `openid`, `profile`, `email`
|
|
26
|
+
4. Note down **Client ID** and **Client Secret**
|
|
27
|
+
|
|
28
|
+
### Configure Redirect URI
|
|
29
|
+
|
|
30
|
+
Add the callback URL to your OIDC provider:
|
|
31
|
+
|
|
32
|
+
<Callout type={'info'}>
|
|
33
|
+
Callback URL format:
|
|
34
|
+
|
|
35
|
+
- Local development: `http://localhost:3210/api/auth/callback/generic-oidc`
|
|
36
|
+
- Production: `https://your-domain.com/api/auth/callback/generic-oidc`
|
|
37
|
+
</Callout>
|
|
38
|
+
|
|
39
|
+
### Find Your Issuer URL
|
|
40
|
+
|
|
41
|
+
The issuer URL is typically found in your provider's OIDC discovery document:
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
https://your-provider/.well-known/openid-configuration
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Look for the `issuer` field in the JSON response.
|
|
48
|
+
|
|
49
|
+
### Configure Environment Variables
|
|
50
|
+
|
|
51
|
+
| Environment Variable | Type | Description |
|
|
52
|
+
| -------------------------------- | -------- | --------------------------------------------------------------- |
|
|
53
|
+
| `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
|
|
54
|
+
| `AUTH_SSO_PROVIDERS` | Required | Set to `generic-oidc` |
|
|
55
|
+
| `AUTH_GENERIC_OIDC_ID` | Required | Client ID |
|
|
56
|
+
| `AUTH_GENERIC_OIDC_SECRET` | Required | Client Secret |
|
|
57
|
+
| `AUTH_GENERIC_OIDC_ISSUER` | Required | OIDC issuer URL (e.g., `https://your-provider.com`) |
|
|
58
|
+
|
|
59
|
+
<Callout type={'tip'}>
|
|
60
|
+
Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#generic-oidc)
|
|
61
|
+
for detailed information.
|
|
62
|
+
</Callout>
|
|
63
|
+
</Steps>
|
|
64
|
+
|
|
65
|
+
<Callout type={'info'}>
|
|
66
|
+
After successful deployment, users will be able to authenticate with your OIDC
|
|
67
|
+
provider and use LobeChat.
|
|
68
|
+
</Callout>
|
|
69
|
+
|
|
70
|
+
## Troubleshooting
|
|
71
|
+
|
|
72
|
+
### Common Issues
|
|
73
|
+
|
|
74
|
+
1. **Invalid redirect URI**: Ensure the callback URL exactly matches what you configured in your provider
|
|
75
|
+
2. **Missing scopes**: Make sure `openid`, `profile`, and `email` scopes are enabled
|
|
76
|
+
3. **Invalid issuer**: The issuer URL must match exactly what's in the OIDC discovery document
|
|
77
|
+
|
|
78
|
+
### Testing OIDC Configuration
|
|
79
|
+
|
|
80
|
+
Verify your OIDC configuration by accessing:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
https://your-provider/.well-known/openid-configuration
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This should return a JSON document with all required endpoints.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中配置 Generic OIDC 身份验证
|
|
3
|
+
description: 学习如何使用 Generic OIDC 集成将 LobeChat 与任何 OpenID Connect 提供商对接。
|
|
4
|
+
tags:
|
|
5
|
+
- Generic OIDC
|
|
6
|
+
- OpenID Connect
|
|
7
|
+
- 身份验证
|
|
8
|
+
- LobeChat
|
|
9
|
+
- 单点登录
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 配置 Generic OIDC 身份验证
|
|
13
|
+
|
|
14
|
+
使用 Generic OIDC 可以将 LobeChat 与任何符合 OpenID Connect 标准的身份提供商集成,适用于不在我们支持列表中的提供商。
|
|
15
|
+
|
|
16
|
+
<Steps>
|
|
17
|
+
### 配置你的 OIDC 提供商
|
|
18
|
+
|
|
19
|
+
在身份提供商的管理控制台中:
|
|
20
|
+
|
|
21
|
+
1. 创建新的 OIDC/OAuth2 应用
|
|
22
|
+
2. 设置应用类型为 **Web Application** 或 **Confidential Client**
|
|
23
|
+
3. 启用必需的 scopes:`openid`、`profile`、`email`
|
|
24
|
+
4. 记下 **Client ID** 和 **Client Secret**
|
|
25
|
+
|
|
26
|
+
### 配置重定向 URI
|
|
27
|
+
|
|
28
|
+
在 OIDC 提供商中添加回调 URL:
|
|
29
|
+
|
|
30
|
+
<Callout type={'info'}>
|
|
31
|
+
回调 URL 格式:
|
|
32
|
+
|
|
33
|
+
- 本地开发: `http://localhost:3210/api/auth/callback/generic-oidc`
|
|
34
|
+
- 生产环境: `https://your-domain.com/api/auth/callback/generic-oidc`
|
|
35
|
+
</Callout>
|
|
36
|
+
|
|
37
|
+
### 查找 Issuer URL
|
|
38
|
+
|
|
39
|
+
Issuer URL 通常在提供商的 OIDC 发现文档中:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
https://your-provider/.well-known/openid-configuration
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
在 JSON 响应中查找 `issuer` 字段。
|
|
46
|
+
|
|
47
|
+
### 配置环境变量
|
|
48
|
+
|
|
49
|
+
| 环境变量 | 类型 | 描述 |
|
|
50
|
+
| -------------------------------- | -- | ---------------------------------------------- |
|
|
51
|
+
| `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
|
|
52
|
+
| `AUTH_SSO_PROVIDERS` | 必选 | 填写 `generic-oidc` |
|
|
53
|
+
| `AUTH_GENERIC_OIDC_ID` | 必选 | Client ID |
|
|
54
|
+
| `AUTH_GENERIC_OIDC_SECRET` | 必选 | Client Secret |
|
|
55
|
+
| `AUTH_GENERIC_OIDC_ISSUER` | 必选 | OIDC Issuer URL(如 `https://your-provider.com`) |
|
|
56
|
+
|
|
57
|
+
<Callout type={'tip'}>
|
|
58
|
+
前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#generic-oidc)
|
|
59
|
+
可查阅相关变量详情。
|
|
60
|
+
</Callout>
|
|
61
|
+
</Steps>
|
|
62
|
+
|
|
63
|
+
<Callout type={'info'}>
|
|
64
|
+
部署成功后,用户将可以通过你的 OIDC 提供商身份认证并使用 LobeChat。
|
|
65
|
+
</Callout>
|
|
66
|
+
|
|
67
|
+
## 故障排除
|
|
68
|
+
|
|
69
|
+
### 常见问题
|
|
70
|
+
|
|
71
|
+
1. **无效的重定向 URI**:确保回调 URL 与提供商中配置的完全匹配
|
|
72
|
+
2. **缺少 scopes**:确保 `openid`、`profile` 和 `email` scopes 已启用
|
|
73
|
+
3. **无效的 issuer**:Issuer URL 必须与 OIDC 发现文档中的完全匹配
|
|
74
|
+
|
|
75
|
+
### 测试 OIDC 配置
|
|
76
|
+
|
|
77
|
+
通过访问以下地址验证 OIDC 配置:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
https://your-provider/.well-known/openid-configuration
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
这应该返回包含所有必需端点的 JSON 文档。
|