@lobehub/lobehub 2.0.0-next.331 → 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.
Files changed (277) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/apps/desktop/src/main/const/dir.ts +3 -0
  3. package/apps/desktop/src/main/controllers/SystemCtr.ts +19 -0
  4. package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -0
  5. package/apps/desktop/src/main/menus/impls/macOS.test.ts +1 -0
  6. package/changelog/v1.json +21 -0
  7. package/docs/changelog/2023-09-09-plugin-system.mdx +3 -2
  8. package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -4
  9. package/docs/changelog/2023-11-19-tts-stt.mdx +3 -2
  10. package/docs/changelog/2023-12-22-dalle-3.mdx +5 -2
  11. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +2 -2
  12. package/docs/changelog/2024-02-08-sso-oauth.mdx +2 -2
  13. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +3 -2
  14. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +2 -2
  15. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +3 -2
  16. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +2 -2
  17. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +3 -2
  18. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +5 -4
  19. package/docs/changelog/2024-09-13-openai-o1-models.mdx +2 -2
  20. package/docs/changelog/2024-09-20-artifacts.mdx +3 -2
  21. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +2 -2
  22. package/docs/changelog/2024-10-27-pin-assistant.mdx +3 -2
  23. package/docs/changelog/2024-11-06-share-text-json.mdx +4 -2
  24. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +2 -2
  25. package/docs/changelog/2024-11-25-november-providers.mdx +2 -2
  26. package/docs/changelog/2024-11-27-forkable-chat.mdx +2 -2
  27. package/docs/changelog/2025-01-03-user-profile.mdx +2 -2
  28. package/docs/changelog/2025-01-22-new-ai-provider.mdx +2 -2
  29. package/docs/changelog/2025-02-02-deepseek-r1.mdx +4 -4
  30. package/docs/development/basic/add-new-authentication-providers.mdx +4 -0
  31. package/docs/development/basic/add-new-authentication-providers.zh-CN.mdx +4 -0
  32. package/docs/development/basic/add-new-image-model.mdx +4 -0
  33. package/docs/development/basic/add-new-image-model.zh-CN.mdx +4 -0
  34. package/docs/development/basic/architecture.mdx +4 -0
  35. package/docs/development/basic/architecture.zh-CN.mdx +4 -0
  36. package/docs/development/basic/chat-api.mdx +4 -0
  37. package/docs/development/basic/chat-api.zh-CN.mdx +4 -0
  38. package/docs/development/basic/comfyui-development.mdx +3 -1
  39. package/docs/development/basic/contributing-guidelines.mdx +4 -0
  40. package/docs/development/basic/contributing-guidelines.zh-CN.mdx +4 -0
  41. package/docs/development/basic/feature-development-frontend.mdx +11 -3
  42. package/docs/development/basic/feature-development-frontend.zh-CN.mdx +11 -3
  43. package/docs/development/basic/feature-development.mdx +14 -5
  44. package/docs/development/basic/feature-development.zh-CN.mdx +14 -5
  45. package/docs/development/basic/folder-structure.mdx +7 -0
  46. package/docs/development/basic/folder-structure.zh-CN.mdx +7 -0
  47. package/docs/development/basic/resources.mdx +4 -0
  48. package/docs/development/basic/resources.zh-CN.mdx +4 -0
  49. package/docs/development/basic/setup-development.mdx +4 -0
  50. package/docs/development/basic/setup-development.zh-CN.mdx +4 -0
  51. package/docs/development/basic/test.mdx +4 -0
  52. package/docs/development/basic/test.zh-CN.mdx +4 -0
  53. package/docs/development/basic/work-with-server-side-database.mdx +5 -5
  54. package/docs/development/basic/work-with-server-side-database.zh-CN.mdx +5 -5
  55. package/docs/development/internationalization/add-new-locale.mdx +4 -0
  56. package/docs/development/internationalization/add-new-locale.zh-CN.mdx +4 -0
  57. package/docs/development/internationalization/internationalization-implementation.mdx +4 -0
  58. package/docs/development/internationalization/internationalization-implementation.zh-CN.mdx +4 -0
  59. package/docs/development/others/lighthouse.mdx +4 -0
  60. package/docs/development/others/lighthouse.zh-CN.mdx +4 -0
  61. package/docs/development/start.mdx +4 -0
  62. package/docs/development/start.zh-CN.mdx +4 -0
  63. package/docs/development/state-management/state-management-intro.mdx +4 -2
  64. package/docs/development/state-management/state-management-intro.zh-CN.mdx +4 -2
  65. package/docs/development/state-management/state-management-selectors.mdx +6 -1
  66. package/docs/development/state-management/state-management-selectors.zh-CN.mdx +6 -1
  67. package/docs/development/tests/integration-testing.zh-CN.mdx +4 -0
  68. package/docs/self-hosting/advanced/analytics.mdx +2 -2
  69. package/docs/self-hosting/advanced/auth/better-auth/apple.mdx +132 -0
  70. package/docs/self-hosting/advanced/auth/better-auth/apple.zh-CN.mdx +127 -0
  71. package/docs/self-hosting/advanced/auth/better-auth/auth0.mdx +111 -0
  72. package/docs/self-hosting/advanced/auth/better-auth/auth0.zh-CN.mdx +107 -0
  73. package/docs/self-hosting/advanced/auth/better-auth/authelia.mdx +66 -0
  74. package/docs/self-hosting/advanced/auth/better-auth/authelia.zh-CN.mdx +62 -0
  75. package/docs/self-hosting/advanced/auth/better-auth/authentik.mdx +67 -0
  76. package/docs/self-hosting/advanced/auth/better-auth/authentik.zh-CN.mdx +63 -0
  77. package/docs/self-hosting/advanced/auth/better-auth/casdoor.mdx +62 -0
  78. package/docs/self-hosting/advanced/auth/better-auth/casdoor.zh-CN.mdx +58 -0
  79. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.mdx +59 -0
  80. package/docs/self-hosting/advanced/auth/better-auth/cloudflare-zero-trust.zh-CN.mdx +55 -0
  81. package/docs/self-hosting/advanced/auth/better-auth/cognito.mdx +88 -0
  82. package/docs/self-hosting/advanced/auth/better-auth/cognito.zh-CN.mdx +85 -0
  83. package/docs/self-hosting/advanced/auth/better-auth/feishu.mdx +73 -0
  84. package/docs/self-hosting/advanced/auth/better-auth/feishu.zh-CN.mdx +69 -0
  85. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.mdx +86 -0
  86. package/docs/self-hosting/advanced/auth/better-auth/generic-oidc.zh-CN.mdx +83 -0
  87. package/docs/self-hosting/advanced/auth/better-auth/github.mdx +93 -0
  88. package/docs/self-hosting/advanced/auth/better-auth/github.zh-CN.mdx +90 -0
  89. package/docs/self-hosting/advanced/auth/better-auth/google.mdx +80 -0
  90. package/docs/self-hosting/advanced/auth/better-auth/google.zh-CN.mdx +77 -0
  91. package/docs/self-hosting/advanced/auth/better-auth/keycloak.mdx +77 -0
  92. package/docs/self-hosting/advanced/auth/better-auth/keycloak.zh-CN.mdx +74 -0
  93. package/docs/self-hosting/advanced/auth/better-auth/logto.mdx +64 -0
  94. package/docs/self-hosting/advanced/auth/better-auth/logto.zh-CN.mdx +60 -0
  95. package/docs/self-hosting/advanced/auth/better-auth/microsoft.mdx +113 -0
  96. package/docs/self-hosting/advanced/auth/better-auth/microsoft.zh-CN.mdx +109 -0
  97. package/docs/self-hosting/advanced/auth/better-auth/okta.mdx +67 -0
  98. package/docs/self-hosting/advanced/auth/better-auth/okta.zh-CN.mdx +63 -0
  99. package/docs/self-hosting/advanced/auth/better-auth/wechat.mdx +77 -0
  100. package/docs/self-hosting/advanced/auth/better-auth/wechat.zh-CN.mdx +72 -0
  101. package/docs/self-hosting/advanced/auth/better-auth/zitadel.mdx +73 -0
  102. package/docs/self-hosting/advanced/auth/better-auth/zitadel.zh-CN.mdx +69 -0
  103. package/docs/self-hosting/advanced/auth/clerk.mdx +2 -2
  104. package/docs/self-hosting/advanced/auth/legacy.mdx +106 -0
  105. package/docs/self-hosting/advanced/auth/legacy.zh-CN.mdx +101 -0
  106. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +3 -2
  107. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +3 -2
  108. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +3 -2
  109. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +5 -2
  110. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -0
  111. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +3 -2
  112. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +2 -2
  113. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +3 -2
  114. package/docs/self-hosting/advanced/auth/next-auth/google.mdx +10 -12
  115. package/docs/self-hosting/advanced/auth/next-auth/keycloak.mdx +3 -2
  116. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +2 -2
  117. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +3 -2
  118. package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +3 -2
  119. package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +1 -3
  120. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +2 -2
  121. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +3 -2
  122. package/docs/self-hosting/advanced/auth.mdx +86 -139
  123. package/docs/self-hosting/advanced/auth.zh-CN.mdx +84 -135
  124. package/docs/self-hosting/advanced/desktop.mdx +9 -3
  125. package/docs/self-hosting/advanced/desktop.zh-CN.mdx +9 -3
  126. package/docs/self-hosting/advanced/feature-flags.mdx +3 -2
  127. package/docs/self-hosting/advanced/knowledge-base.mdx +2 -2
  128. package/docs/self-hosting/advanced/model-list.mdx +2 -2
  129. package/docs/self-hosting/advanced/observability/grafana.mdx +4 -2
  130. package/docs/self-hosting/advanced/observability/grafana.zh-CN.mdx +2 -1
  131. package/docs/self-hosting/advanced/observability/langfuse.mdx +3 -2
  132. package/docs/self-hosting/advanced/online-search.mdx +4 -6
  133. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +2 -2
  134. package/docs/self-hosting/advanced/settings-url-share.mdx +3 -2
  135. package/docs/self-hosting/advanced/upstream-sync.mdx +3 -4
  136. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +0 -2
  137. package/docs/self-hosting/environment-variables/analytics.mdx +3 -2
  138. package/docs/self-hosting/environment-variables/auth.mdx +5 -12
  139. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +2 -9
  140. package/docs/self-hosting/environment-variables/basic.mdx +3 -10
  141. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +0 -7
  142. package/docs/self-hosting/environment-variables/model-provider.mdx +3 -4
  143. package/docs/self-hosting/environment-variables/s3.mdx +2 -2
  144. package/docs/self-hosting/environment-variables.mdx +2 -3
  145. package/docs/self-hosting/examples/azure-openai.mdx +2 -3
  146. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +0 -1
  147. package/docs/self-hosting/examples/ollama.mdx +3 -2
  148. package/docs/self-hosting/faq/no-v1-suffix.mdx +4 -4
  149. package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +3 -2
  150. package/docs/self-hosting/faq/vercel-ai-image-timeout.mdx +2 -2
  151. package/docs/self-hosting/migration/v2/breaking-changes.mdx +73 -0
  152. package/docs/self-hosting/migration/v2/breaking-changes.zh-CN.mdx +71 -0
  153. package/docs/self-hosting/platform/alibaba-cloud.mdx +2 -7
  154. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -6
  155. package/docs/self-hosting/platform/btpanel.mdx +4 -2
  156. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +2 -2
  157. package/docs/self-hosting/platform/docker-compose.mdx +3 -3
  158. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +0 -1
  159. package/docs/self-hosting/platform/docker.mdx +2 -11
  160. package/docs/self-hosting/platform/docker.zh-CN.mdx +0 -8
  161. package/docs/self-hosting/platform/netlify.mdx +5 -17
  162. package/docs/self-hosting/platform/netlify.zh-CN.mdx +3 -17
  163. package/docs/self-hosting/platform/railway.mdx +3 -7
  164. package/docs/self-hosting/platform/railway.zh-CN.mdx +1 -7
  165. package/docs/self-hosting/platform/repocloud.mdx +3 -7
  166. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +1 -6
  167. package/docs/self-hosting/platform/sealos.mdx +2 -7
  168. package/docs/self-hosting/platform/sealos.zh-CN.mdx +1 -6
  169. package/docs/self-hosting/platform/tencentcloud-lighthouse.mdx +2 -7
  170. package/docs/self-hosting/platform/tencentcloud-lighthouse.zh-CN.mdx +1 -6
  171. package/docs/self-hosting/platform/vercel.mdx +4 -9
  172. package/docs/self-hosting/platform/vercel.zh-CN.mdx +3 -8
  173. package/docs/self-hosting/platform/zeabur.mdx +2 -11
  174. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +1 -10
  175. package/docs/self-hosting/server-database/docker-compose.mdx +11 -19
  176. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +12 -21
  177. package/docs/self-hosting/server-database/docker.mdx +9 -24
  178. package/docs/self-hosting/server-database/docker.zh-CN.mdx +7 -24
  179. package/docs/self-hosting/server-database/dokploy.mdx +27 -25
  180. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +23 -21
  181. package/docs/self-hosting/server-database/netlify.mdx +2 -2
  182. package/docs/self-hosting/server-database/netlify.zh-CN.mdx +2 -2
  183. package/docs/self-hosting/server-database/railway.mdx +2 -2
  184. package/docs/self-hosting/server-database/repocloud.mdx +2 -2
  185. package/docs/self-hosting/server-database/sealos.mdx +2 -2
  186. package/docs/self-hosting/server-database/vercel.mdx +19 -72
  187. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +17 -68
  188. package/docs/self-hosting/server-database/zeabur.mdx +2 -2
  189. package/docs/self-hosting/server-database.mdx +1 -19
  190. package/docs/self-hosting/server-database.zh-CN.mdx +0 -17
  191. package/docs/self-hosting/start.mdx +2 -2
  192. package/docs/self-hosting/start.zh-CN.mdx +2 -2
  193. package/e2e/src/support/webServer.ts +95 -43
  194. package/locales/ar/chat.json +5 -0
  195. package/locales/ar/desktop-onboarding.json +5 -0
  196. package/locales/ar/discover.json +15 -0
  197. package/locales/ar/models.json +35 -0
  198. package/locales/bg-BG/chat.json +5 -0
  199. package/locales/bg-BG/desktop-onboarding.json +5 -0
  200. package/locales/bg-BG/discover.json +15 -0
  201. package/locales/bg-BG/models.json +30 -0
  202. package/locales/de-DE/chat.json +5 -0
  203. package/locales/de-DE/desktop-onboarding.json +5 -0
  204. package/locales/de-DE/discover.json +15 -0
  205. package/locales/de-DE/models.json +38 -0
  206. package/locales/en-US/desktop-onboarding.json +6 -0
  207. package/locales/en-US/discover.json +14 -0
  208. package/locales/es-ES/chat.json +5 -0
  209. package/locales/es-ES/desktop-onboarding.json +5 -0
  210. package/locales/es-ES/discover.json +15 -0
  211. package/locales/es-ES/models.json +38 -0
  212. package/locales/fa-IR/chat.json +5 -0
  213. package/locales/fa-IR/desktop-onboarding.json +5 -0
  214. package/locales/fa-IR/discover.json +15 -0
  215. package/locales/fa-IR/models.json +11 -0
  216. package/locales/fr-FR/chat.json +5 -0
  217. package/locales/fr-FR/desktop-onboarding.json +5 -0
  218. package/locales/fr-FR/discover.json +15 -0
  219. package/locales/fr-FR/models.json +36 -0
  220. package/locales/it-IT/chat.json +5 -0
  221. package/locales/it-IT/desktop-onboarding.json +5 -0
  222. package/locales/it-IT/discover.json +15 -0
  223. package/locales/it-IT/models.json +32 -0
  224. package/locales/ja-JP/chat.json +5 -0
  225. package/locales/ja-JP/desktop-onboarding.json +5 -0
  226. package/locales/ja-JP/discover.json +15 -0
  227. package/locales/ja-JP/models.json +42 -0
  228. package/locales/ko-KR/chat.json +5 -0
  229. package/locales/ko-KR/desktop-onboarding.json +5 -0
  230. package/locales/ko-KR/discover.json +15 -0
  231. package/locales/ko-KR/models.json +55 -0
  232. package/locales/nl-NL/chat.json +5 -0
  233. package/locales/nl-NL/desktop-onboarding.json +5 -0
  234. package/locales/nl-NL/discover.json +15 -0
  235. package/locales/nl-NL/models.json +34 -0
  236. package/locales/pl-PL/chat.json +5 -0
  237. package/locales/pl-PL/desktop-onboarding.json +5 -0
  238. package/locales/pl-PL/discover.json +15 -0
  239. package/locales/pl-PL/models.json +31 -0
  240. package/locales/pt-BR/chat.json +5 -0
  241. package/locales/pt-BR/desktop-onboarding.json +5 -0
  242. package/locales/pt-BR/discover.json +15 -0
  243. package/locales/pt-BR/models.json +42 -0
  244. package/locales/ru-RU/chat.json +5 -0
  245. package/locales/ru-RU/desktop-onboarding.json +5 -0
  246. package/locales/ru-RU/discover.json +15 -0
  247. package/locales/ru-RU/models.json +32 -0
  248. package/locales/tr-TR/chat.json +5 -0
  249. package/locales/tr-TR/desktop-onboarding.json +5 -0
  250. package/locales/tr-TR/discover.json +15 -0
  251. package/locales/tr-TR/models.json +48 -0
  252. package/locales/vi-VN/chat.json +5 -0
  253. package/locales/vi-VN/desktop-onboarding.json +5 -0
  254. package/locales/vi-VN/discover.json +15 -0
  255. package/locales/vi-VN/models.json +36 -0
  256. package/locales/zh-CN/desktop-onboarding.json +4 -3
  257. package/locales/zh-CN/discover.json +14 -0
  258. package/locales/zh-CN/models.json +1 -0
  259. package/locales/zh-TW/chat.json +5 -0
  260. package/locales/zh-TW/desktop-onboarding.json +5 -0
  261. package/locales/zh-TW/discover.json +15 -0
  262. package/locales/zh-TW/models.json +42 -0
  263. package/package.json +2 -2
  264. package/packages/builtin-tool-cloud-sandbox/src/systemRole.ts +62 -2
  265. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/index.ts +2 -0
  266. package/packages/conversation-flow/src/__tests__/fixtures/inputs/tasks/multi-tasks-with-summary.json +234 -0
  267. package/packages/conversation-flow/src/__tests__/parse.test.ts +25 -0
  268. package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +15 -0
  269. package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +20 -0
  270. package/packages/types/src/serverConfig.ts +0 -1
  271. package/src/app/[variants]/(desktop)/desktop-onboarding/features/LoginStep.tsx +39 -1
  272. package/src/app/[variants]/(main)/settings/common/features/Common/Common.tsx +34 -14
  273. package/src/envs/app.ts +0 -13
  274. package/src/locales/default/desktop-onboarding.ts +1 -0
  275. package/src/server/globalConfig/index.ts +1 -2
  276. package/src/services/electron/system.ts +4 -0
  277. package/src/store/serverConfig/selectors.ts +0 -1
@@ -0,0 +1,113 @@
1
+ ---
2
+ title: Configuring Microsoft Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Microsoft (Entra ID / Azure AD) SSO for LobeChat,
5
+ including creating applications in Azure Portal and setting up environment
6
+ variables.
7
+ tags:
8
+ - Microsoft
9
+ - Authentication
10
+ - Azure AD
11
+ - LobeChat
12
+ - Single Sign-On
13
+ ---
14
+
15
+ # Configuring Microsoft Authentication
16
+
17
+ <Steps>
18
+ ### Create a Microsoft Entra ID Application
19
+
20
+ 1. Go to [Microsoft Entra Admin Center](https://entra.microsoft.com/)
21
+ 2. Navigate to **Identity** > **Applications** > **App registrations** > **New registration**
22
+ 3. Fill in the application name
23
+ 4. Choose supported account types:
24
+ - **Single tenant**: Only users in your organization
25
+ - **Multitenant**: Users in any Azure AD organization
26
+ - **Multitenant + personal**: Also includes personal Microsoft accounts
27
+
28
+ <Image alt="App Register" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d" />
29
+
30
+ ### Configure Redirect URI
31
+
32
+ In the **Redirect URI** section:
33
+
34
+ 1. Select **Web** as the platform
35
+ 2. Enter the callback URL
36
+
37
+ <Callout type={'info'}>
38
+ Callback URL format:
39
+
40
+ - Local development: `http://localhost:3210/api/auth/callback/microsoft`
41
+ - Production: `https://your-domain.com/api/auth/callback/microsoft`
42
+ </Callout>
43
+
44
+ Click **Register**.
45
+
46
+ ### Get Application Credentials
47
+
48
+ After creation, view the **Overview** tab:
49
+
50
+ <Image alt="App Overview" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a" />
51
+
52
+ Note down:
53
+
54
+ - **Application (client) ID** - This is your `AUTH_MICROSOFT_ID`
55
+ - **Directory (tenant) ID** - Needed for single-tenant apps
56
+
57
+ ### Create Client Secret
58
+
59
+ 1. Go to **Certificates & secrets** > **Client secrets**
60
+ 2. Click **New client secret**
61
+ 3. Fill in description and select expiration time
62
+ 4. Click **Add**
63
+
64
+ <Image alt="Create App Client Secret" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2" />
65
+
66
+ <Callout type={'warning'}>
67
+ Copy the client secret **Value** immediately - you won't be able to see it
68
+ again.
69
+ </Callout>
70
+
71
+ ### Configure Environment Variables
72
+
73
+ | Environment Variable | Type | Description |
74
+ | -------------------------------- | -------- | --------------------------------------------------------------- |
75
+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
76
+ | `AUTH_SSO_PROVIDERS` | Required | Set to `microsoft` |
77
+ | `AUTH_MICROSOFT_ID` | Required | Application (client) ID |
78
+ | `AUTH_MICROSOFT_SECRET` | Required | Client secret value |
79
+
80
+ <Callout type={'info'}>
81
+ **Alternative Environment Variables**: For backward compatibility, these
82
+ aliases are also supported:
83
+
84
+ - `AUTH_MICROSOFT_ENTRA_ID_ID` / `AUTH_MICROSOFT_ENTRA_ID_SECRET`
85
+ - `AUTH_AZURE_AD_ID` / `AUTH_AZURE_AD_SECRET`
86
+ - `AZURE_AD_CLIENT_ID` / `AZURE_AD_CLIENT_SECRET`
87
+ </Callout>
88
+
89
+ <Callout type={'tip'}>
90
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#microsoft)
91
+ for detailed information.
92
+ </Callout>
93
+ </Steps>
94
+
95
+ <Callout type={'info'}>
96
+ After successful deployment, users will be able to authenticate with Microsoft
97
+ and use LobeChat.
98
+ </Callout>
99
+
100
+ ## Common Issues
101
+
102
+ ### Tenant Configuration
103
+
104
+ By default, LobeChat uses `common` tenant which allows both organizational and personal Microsoft accounts. If you need single-tenant configuration, you may need to customize the tenant settings.
105
+
106
+ ### Client Secret Expiration
107
+
108
+ Microsoft client secrets have a maximum validity of 24 months. Remember to rotate secrets before they expire.
109
+
110
+ ## Related Resources
111
+
112
+ - [Microsoft Entra Admin Center](https://entra.microsoft.com/)
113
+ - [Quickstart: Register an application](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)
@@ -0,0 +1,109 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Microsoft 身份验证
3
+ description: >-
4
+ 学习如何在 LobeChat 中配置 Microsoft (Entra ID / Azure AD) SSO,包括在 Azure Portal
5
+ 创建应用和设置环境变量。
6
+ tags:
7
+ - Microsoft
8
+ - 身份验证
9
+ - Azure AD
10
+ - LobeChat
11
+ - 单点登录
12
+ ---
13
+
14
+ # 配置 Microsoft 身份验证
15
+
16
+ <Steps>
17
+ ### 创建 Microsoft Entra ID 应用
18
+
19
+ 1. 前往 [Microsoft Entra 管理中心](https://entra.microsoft.com/)
20
+ 2. 导航到 **Identity** > **Applications** > **App registrations** > **New registration**
21
+ 3. 填写应用名称
22
+ 4. 选择支持的帐户类型:
23
+ - **Single tenant**:仅限组织内用户
24
+ - **Multitenant**:任何 Azure AD 组织的用户
25
+ - **Multitenant + personal**:也包括个人 Microsoft 帐户
26
+
27
+ <Image alt="应用注册" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/4f9d83bd-b3fc-4abc-bcf4-ccbad65c219d" />
28
+
29
+ ### 配置重定向 URI
30
+
31
+ 在 **Redirect URI** 部分:
32
+
33
+ 1. 选择 **Web** 作为平台
34
+ 2. 输入回调 URL
35
+
36
+ <Callout type={'info'}>
37
+ 回调 URL 格式:
38
+
39
+ - 本地开发: `http://localhost:3210/api/auth/callback/microsoft`
40
+ - 生产环境: `https://your-domain.com/api/auth/callback/microsoft`
41
+ </Callout>
42
+
43
+ 点击 **Register**。
44
+
45
+ ### 获取应用凭证
46
+
47
+ 创建后,查看 **Overview** 标签页:
48
+
49
+ <Image alt="应用概览" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/48a0b702-05bd-4ce4-a007-a8ad00a36e5a" />
50
+
51
+ 记录:
52
+
53
+ - **Application (client) ID** - 即 `AUTH_MICROSOFT_ID`
54
+ - **Directory (tenant) ID** - 单租户应用需要
55
+
56
+ ### 创建客户端密钥
57
+
58
+ 1. 前往 **Certificates & secrets** > **Client secrets**
59
+ 2. 点击 **New client secret**
60
+ 3. 填写描述并选择过期时间
61
+ 4. 点击 **Add**
62
+
63
+ <Image alt="创建客户端密钥" inStep src="https://github.com/lobehub/lobe-chat/assets/13883964/c9d66fa0-158c-4bd3-a1fa-969e638259d2" />
64
+
65
+ <Callout type={'warning'}>
66
+ 立即复制客户端密钥的 **Value** - 之后将无法再次查看。
67
+ </Callout>
68
+
69
+ ### 配置环境变量
70
+
71
+ | 环境变量 | 类型 | 描述 |
72
+ | -------------------------------- | -- | -------------------------------------- |
73
+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
74
+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `microsoft` |
75
+ | `AUTH_MICROSOFT_ID` | 必选 | Application (client) ID |
76
+ | `AUTH_MICROSOFT_SECRET` | 必选 | 客户端密钥值 |
77
+
78
+ <Callout type={'info'}>
79
+ **兼容的环境变量**:为了向后兼容,以下别名也支持:
80
+
81
+ - `AUTH_MICROSOFT_ENTRA_ID_ID` / `AUTH_MICROSOFT_ENTRA_ID_SECRET`
82
+ - `AUTH_AZURE_AD_ID` / `AUTH_AZURE_AD_SECRET`
83
+ - `AZURE_AD_CLIENT_ID` / `AZURE_AD_CLIENT_SECRET`
84
+ </Callout>
85
+
86
+ <Callout type={'tip'}>
87
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#microsoft)
88
+ 可查阅相关变量详情。
89
+ </Callout>
90
+ </Steps>
91
+
92
+ <Callout type={'info'}>
93
+ 部署成功后,用户将可以通过 Microsoft 身份认证并使用 LobeChat。
94
+ </Callout>
95
+
96
+ ## 常见问题
97
+
98
+ ### 租户配置
99
+
100
+ 默认情况下,LobeChat 使用 `common` 租户,允许组织帐户和个人 Microsoft 帐户登录。如果需要单租户配置,可能需要自定义租户设置。
101
+
102
+ ### 客户端密钥过期
103
+
104
+ Microsoft 客户端密钥最长有效期为 24 个月。请记得在过期前轮换密钥。
105
+
106
+ ## 相关资源
107
+
108
+ - [Microsoft Entra 管理中心](https://entra.microsoft.com/)
109
+ - [快速入门:注册应用](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app)
@@ -0,0 +1,67 @@
1
+ ---
2
+ title: Configuring Okta Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure Okta SSO for LobeChat, including creating an
5
+ application and setting up environment variables.
6
+ tags:
7
+ - Okta
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ - OIDC
12
+ ---
13
+
14
+ # Configuring Okta Authentication
15
+
16
+ [Okta](https://www.okta.com/) is a leading identity and access management platform.
17
+
18
+ <Steps>
19
+ ### Create Application in Okta
20
+
21
+ 1. Log in to Okta Admin Console
22
+ 2. Go to **Applications** > **Applications**
23
+ 3. Click **Create App Integration**
24
+ 4. Select:
25
+ - Sign-in method: **OIDC - OpenID Connect**
26
+ - Application type: **Web Application**
27
+ 5. Configure the application:
28
+ - App integration name: `LobeChat`
29
+ - Sign-in redirect URIs: Add your callback URL
30
+
31
+ <Callout type={'info'}>
32
+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/okta`
33
+ </Callout>
34
+
35
+ 6. After creation, note down the **Client ID** and **Client Secret**
36
+
37
+ ### Get Issuer URL
38
+
39
+ The issuer URL is typically: `https://your-okta-domain.okta.com`
40
+
41
+ For custom authorization servers: `https://your-okta-domain.okta.com/oauth2/default`
42
+
43
+ ### Configure Environment Variables
44
+
45
+ When deploying LobeChat, you need to configure the following environment variables:
46
+
47
+ | Environment Variable | Type | Description |
48
+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
49
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
50
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `okta` for Okta |
51
+ | `AUTH_OKTA_ID` | Required | Client ID from Okta application |
52
+ | `AUTH_OKTA_SECRET` | Required | Client Secret from Okta application |
53
+ | `AUTH_OKTA_ISSUER` | Required | Okta issuer URL (e.g., `https://your-okta-domain.okta.com`) |
54
+
55
+ <Callout type={'tip'}>
56
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#okta) for detailed information on these variables.
57
+ </Callout>
58
+ </Steps>
59
+
60
+ <Callout type={'info'}>
61
+ After successful deployment, users will be able to authenticate with Okta and use LobeChat.
62
+ </Callout>
63
+
64
+ ## Related Resources
65
+
66
+ - [Okta Developer Documentation](https://developer.okta.com/docs/)
67
+ - [Create OIDC App Integration](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/)
@@ -0,0 +1,63 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 Okta 身份验证
3
+ description: 学习如何在 LobeChat 中配置 Okta SSO,包括创建应用和设置环境变量。
4
+ tags:
5
+ - Okta
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ - OIDC
10
+ ---
11
+
12
+ # 配置 Okta 身份验证
13
+
14
+ [Okta](https://www.okta.com/) 是领先的身份和访问管理平台。
15
+
16
+ <Steps>
17
+ ### 在 Okta 中创建应用
18
+
19
+ 1. 登录 Okta 管理控制台
20
+ 2. 前往 **Applications** > **Applications**
21
+ 3. 点击 **Create App Integration**
22
+ 4. 选择:
23
+ - Sign-in method: **OIDC - OpenID Connect**
24
+ - Application type: **Web Application**
25
+ 5. 配置应用:
26
+ - App integration name: `LobeChat`
27
+ - Sign-in redirect URIs: 添加回调 URL
28
+
29
+ <Callout type={'info'}>
30
+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/okta`
31
+ </Callout>
32
+
33
+ 6. 创建后,记下 **Client ID** 和 **Client Secret**
34
+
35
+ ### 获取 Issuer URL
36
+
37
+ Issuer URL 通常为:`https://your-okta-domain.okta.com`
38
+
39
+ 对于自定义授权服务器:`https://your-okta-domain.okta.com/oauth2/default`
40
+
41
+ ### 配置环境变量
42
+
43
+ 在部署 LobeChat 时,你需要配置以下环境变量:
44
+
45
+ | 环境变量 | 类型 | 描述 |
46
+ | -------------------------------- | -- | ------------------------------------------------------- |
47
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
48
+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 Okta 请填写 `okta` |
49
+ | `AUTH_OKTA_ID` | 必选 | Okta 应用的 Client ID |
50
+ | `AUTH_OKTA_SECRET` | 必选 | Okta 应用的 Client Secret |
51
+ | `AUTH_OKTA_ISSUER` | 必选 | Okta Issuer URL(例如 `https://your-okta-domain.okta.com`) |
52
+
53
+ <Callout type={'tip'}>
54
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#okta) 可查阅相关变量详情。
55
+ </Callout>
56
+ </Steps>
57
+
58
+ <Callout type={'info'}>部署成功后,用户将可以通过 Okta 身份认证并使用 LobeChat。</Callout>
59
+
60
+ ## 相关资源
61
+
62
+ - [Okta 开发者文档](https://developer.okta.com/docs/)
63
+ - [创建 OIDC 应用集成](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/)
@@ -0,0 +1,77 @@
1
+ ---
2
+ title: Configuring WeChat Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure WeChat SSO for LobeChat, including creating an
5
+ application on WeChat Open Platform.
6
+ tags:
7
+ - WeChat
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ ---
12
+
13
+ # Configuring WeChat Authentication
14
+
15
+ [WeChat Open Platform](https://open.weixin.qq.com/) enables third-party applications to integrate WeChat login.
16
+
17
+ <Callout type={'warning'}>
18
+ WeChat Web Login requires a verified WeChat Open Platform account and an
19
+ approved website application. This process requires business verification in
20
+ China.
21
+ </Callout>
22
+
23
+ <Steps>
24
+ ### Create Website Application on WeChat Open Platform
25
+
26
+ 1. Go to [WeChat Open Platform](https://open.weixin.qq.com/)
27
+ 2. Register and verify your developer account
28
+ 3. Go to **Management Center** > **Website Application**
29
+ 4. Click **Create Website Application**
30
+ 5. Fill in the application information and submit for review
31
+
32
+ ### Configure OAuth Settings
33
+
34
+ After your application is approved:
35
+
36
+ 1. Go to your application settings
37
+ 2. In **Website Information**, configure the callback domain
38
+
39
+ <Callout type={'info'}>
40
+ Callback domain format:
41
+
42
+ - **Callback Domain**: `your-domain.com` (without protocol or path)
43
+ - **Full Callback URL**: `https://your-domain.com/api/auth/callback/wechat`
44
+ </Callout>
45
+
46
+ 3. Note down the **AppID** and **AppSecret**
47
+
48
+ ### Configure Environment Variables
49
+
50
+ | Environment Variable | Type | Description |
51
+ | -------------------------------- | -------- | --------------------------------------------------------------- |
52
+ | `AUTH_SECRET` | Required | Session encryption key, generate with `openssl rand -base64 32` |
53
+ | `AUTH_SSO_PROVIDERS` | Required | Set to `wechat` |
54
+ | `AUTH_WECHAT_ID` | Required | AppID from WeChat Open Platform |
55
+ | `AUTH_WECHAT_SECRET` | Required | AppSecret from WeChat Open Platform |
56
+
57
+ <Callout type={'tip'}>
58
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#wechat)
59
+ for detailed information.
60
+ </Callout>
61
+ </Steps>
62
+
63
+ <Callout type={'info'}>
64
+ After successful deployment, users will be able to authenticate with WeChat
65
+ and use LobeChat.
66
+ </Callout>
67
+
68
+ ## Notes
69
+
70
+ - WeChat login uses QR code scanning, users need to use WeChat mobile app
71
+ - A verified WeChat Open Platform account is required
72
+ - The callback domain must be filed with ICP in China
73
+
74
+ ## Related Resources
75
+
76
+ - [WeChat Open Platform](https://open.weixin.qq.com/)
77
+ - [WeChat Login Documentation](https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html)
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: 在 LobeChat 中配置微信身份验证
3
+ description: 学习如何在 LobeChat 中配置微信 SSO,包括在微信开放平台创建应用。
4
+ tags:
5
+ - 微信
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ ---
10
+
11
+ # 配置微信身份验证
12
+
13
+ [微信开放平台](https://open.weixin.qq.com/) 支持第三方应用接入微信登录功能。
14
+
15
+ <Callout type={'warning'}>
16
+ 微信网页登录需要经过认证的微信开放平台账号,以及通过微信审核的网站应用。此流程需要在中国进行企业认证。
17
+ </Callout>
18
+
19
+ <Steps>
20
+ ### 在微信开放平台创建网站应用
21
+
22
+ 1. 前往 [微信开放平台](https://open.weixin.qq.com/)
23
+ 2. 注册并验证开发者账号
24
+ 3. 前往 **管理中心** > **网站应用**
25
+ 4. 点击 **创建网站应用**
26
+ 5. 填写应用信息并提交审核
27
+
28
+ ### 配置 OAuth 设置
29
+
30
+ 应用审核通过后:
31
+
32
+ 1. 进入应用设置
33
+ 2. 在 **网站信息** 中配置回调域名
34
+
35
+ <Callout type={'info'}>
36
+ 回调域名格式:
37
+
38
+ - **回调域名**: `your-domain.com`(不含协议和路径)
39
+ - **完整回调 URL**: `https://your-domain.com/api/auth/callback/wechat`
40
+ </Callout>
41
+
42
+ 3. 记下 **AppID** 和 **AppSecret**
43
+
44
+ ### 配置环境变量
45
+
46
+ | 环境变量 | 类型 | 描述 |
47
+ | -------------------------------- | -- | -------------------------------------- |
48
+ | `AUTH_SECRET` | 必选 | 会话加密密钥,使用 `openssl rand -base64 32` 生成 |
49
+ | `AUTH_SSO_PROVIDERS` | 必选 | 填写 `wechat` |
50
+ | `AUTH_WECHAT_ID` | 必选 | 微信开放平台的 AppID |
51
+ | `AUTH_WECHAT_SECRET` | 必选 | 微信开放平台的 AppSecret |
52
+
53
+ <Callout type={'tip'}>
54
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#wechat)
55
+ 可查阅相关变量详情。
56
+ </Callout>
57
+ </Steps>
58
+
59
+ <Callout type={'info'}>
60
+ 部署成功后,用户将可以通过微信身份认证并使用 LobeChat。
61
+ </Callout>
62
+
63
+ ## 注意事项
64
+
65
+ - 微信登录使用扫码方式,用户需要使用微信手机端扫码
66
+ - 需要经过认证的微信开放平台账号
67
+ - 回调域名需要在中国进行 ICP 备案
68
+
69
+ ## 相关资源
70
+
71
+ - [微信开放平台](https://open.weixin.qq.com/)
72
+ - [微信登录文档](https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html)
@@ -0,0 +1,73 @@
1
+ ---
2
+ title: Configuring ZITADEL Authentication for LobeChat
3
+ description: >-
4
+ Learn how to configure ZITADEL SSO for LobeChat, including creating an
5
+ application and setting up environment variables.
6
+ tags:
7
+ - ZITADEL
8
+ - Authentication
9
+ - LobeChat
10
+ - Single Sign-On
11
+ - OIDC
12
+ ---
13
+
14
+ # Configuring ZITADEL Authentication
15
+
16
+ [ZITADEL](https://zitadel.com/) is an open-source identity infrastructure with built-in multi-tenancy.
17
+
18
+ <Steps>
19
+ ### Create Application in ZITADEL
20
+
21
+ 1. Log in to ZITADEL Console
22
+ 2. Go to your project (or create a new one)
23
+ 3. Click **New** to create a new application
24
+ 4. Select **Web** as the application type
25
+ 5. Configure:
26
+ - Name: `LobeChat`
27
+ - Authentication Method: `CODE` (for confidential clients)
28
+ 6. Add redirect URI:
29
+
30
+ <Callout type={'info'}>
31
+ **Callback URL Format**: `https://your-domain.com/api/auth/callback/zitadel`
32
+ </Callout>
33
+
34
+ 7. After creation, note down the **Client ID** and generate a **Client Secret**
35
+
36
+ ### Get Issuer URL
37
+
38
+ The issuer URL is your ZITADEL instance URL, typically:
39
+
40
+ - Cloud: `https://your-instance.zitadel.cloud`
41
+ - Self-hosted: `https://your-zitadel-domain`
42
+
43
+ ### Configure Environment Variables
44
+
45
+ When deploying LobeChat, you need to configure the following environment variables:
46
+
47
+ | Environment Variable | Type | Description |
48
+ | -------------------------------- | -------- | ----------------------------------------------------------------------------- |
49
+ | `AUTH_SECRET` | Required | Key used to encrypt session tokens. Generate using: `openssl rand -base64 32` |
50
+ | `AUTH_SSO_PROVIDERS` | Required | SSO provider for LobeChat. Use `zitadel` for ZITADEL |
51
+ | `AUTH_ZITADEL_ID` | Required | Client ID from ZITADEL application |
52
+ | `AUTH_ZITADEL_SECRET` | Required | Client Secret from ZITADEL application |
53
+ | `AUTH_ZITADEL_ISSUER` | Required | ZITADEL issuer URL (e.g., `https://your-instance.zitadel.cloud`) |
54
+
55
+ <Callout type={'info'}>
56
+ **Alternative Environment Variables**: For backward compatibility, the following aliases are also supported:
57
+
58
+ - `ZITADEL_CLIENT_ID` / `ZITADEL_CLIENT_SECRET` / `ZITADEL_ISSUER`
59
+ </Callout>
60
+
61
+ <Callout type={'tip'}>
62
+ Go to [📘 Environment Variables](/docs/self-hosting/environment-variables/auth#zitadel) for detailed information on these variables.
63
+ </Callout>
64
+ </Steps>
65
+
66
+ <Callout type={'info'}>
67
+ After successful deployment, users will be able to authenticate with ZITADEL and use LobeChat.
68
+ </Callout>
69
+
70
+ ## Related Resources
71
+
72
+ - [ZITADEL Documentation](https://zitadel.com/docs)
73
+ - [ZITADEL Application Setup](https://zitadel.com/docs/guides/integrate/login-users)
@@ -0,0 +1,69 @@
1
+ ---
2
+ title: 在 LobeChat 中配置 ZITADEL 身份验证
3
+ description: 学习如何在 LobeChat 中配置 ZITADEL SSO,包括创建应用和设置环境变量。
4
+ tags:
5
+ - ZITADEL
6
+ - 身份验证
7
+ - LobeChat
8
+ - 单点登录
9
+ - OIDC
10
+ ---
11
+
12
+ # 配置 ZITADEL 身份验证
13
+
14
+ [ZITADEL](https://zitadel.com/) 是一个开源的身份基础设施,内置多租户支持。
15
+
16
+ <Steps>
17
+ ### 在 ZITADEL 中创建应用
18
+
19
+ 1. 登录 ZITADEL 控制台
20
+ 2. 前往你的项目(或创建新项目)
21
+ 3. 点击 **New** 创建新应用
22
+ 4. 选择 **Web** 作为应用类型
23
+ 5. 配置:
24
+ - Name: `LobeChat`
25
+ - Authentication Method: `CODE`(用于机密客户端)
26
+ 6. 添加重定向 URI:
27
+
28
+ <Callout type={'info'}>
29
+ **回调 URL 格式**: `https://your-domain.com/api/auth/callback/zitadel`
30
+ </Callout>
31
+
32
+ 7. 创建后,记下 **Client ID** 并生成 **Client Secret**
33
+
34
+ ### 获取 Issuer URL
35
+
36
+ Issuer URL 是 ZITADEL 实例 URL,通常为:
37
+
38
+ - 云版:`https://your-instance.zitadel.cloud`
39
+ - 自托管:`https://your-zitadel-domain`
40
+
41
+ ### 配置环境变量
42
+
43
+ 在部署 LobeChat 时,你需要配置以下环境变量:
44
+
45
+ | 环境变量 | 类型 | 描述 |
46
+ | -------------------------------- | -- | ------------------------------------------------------------ |
47
+ | `AUTH_SECRET` | 必选 | 用于加密会话令牌的密钥。使用以下命令生成:`openssl rand -base64 32` |
48
+ | `AUTH_SSO_PROVIDERS` | 必选 | SSO 提供商。使用 ZITADEL 请填写 `zitadel` |
49
+ | `AUTH_ZITADEL_ID` | 必选 | ZITADEL 应用的 Client ID |
50
+ | `AUTH_ZITADEL_SECRET` | 必选 | ZITADEL 应用的 Client Secret |
51
+ | `AUTH_ZITADEL_ISSUER` | 必选 | ZITADEL Issuer URL(例如 `https://your-instance.zitadel.cloud`) |
52
+
53
+ <Callout type={'info'}>
54
+ **兼容的环境变量**:为了向后兼容,以下别名也支持:
55
+
56
+ - `ZITADEL_CLIENT_ID` / `ZITADEL_CLIENT_SECRET` / `ZITADEL_ISSUER`
57
+ </Callout>
58
+
59
+ <Callout type={'tip'}>
60
+ 前往 [📘 环境变量](/zh/docs/self-hosting/environment-variables/auth#zitadel) 可查阅相关变量详情。
61
+ </Callout>
62
+ </Steps>
63
+
64
+ <Callout type={'info'}>部署成功后,用户将可以通过 ZITADEL 身份认证并使用 LobeChat。</Callout>
65
+
66
+ ## 相关资源
67
+
68
+ - [ZITADEL 文档](https://zitadel.com/docs)
69
+ - [ZITADEL 应用设置](https://zitadel.com/docs/guides/integrate/login-users)
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  title: Configure Clerk Authentication Service - Step-by-Step Guide
3
3
  description: >-
4
- Learn how to set up Clerk authentication with environment variables and webhooks.
5
-
4
+ Learn how to set up Clerk authentication with environment variables and
5
+ webhooks.
6
6
  tags:
7
7
  - Clerk Authentication
8
8
  - Environment Variables