@lobehub/chat 0.153.1 → 0.154.1
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 +50 -0
- package/docs/self-hosting/advanced/authentication.mdx +25 -18
- package/docs/self-hosting/advanced/authentication.zh-CN.mdx +26 -17
- package/docs/self-hosting/advanced/model-list.mdx +2 -2
- package/docs/self-hosting/advanced/model-list.zh-CN.mdx +2 -2
- package/docs/self-hosting/environment-variables/auth.mdx +48 -39
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +49 -43
- package/locales/ar/auth.json +6 -0
- package/locales/ar/clerk.json +769 -0
- package/locales/ar/common.json +1 -0
- package/locales/ar/error.json +8 -0
- package/locales/bg-BG/auth.json +6 -0
- package/locales/bg-BG/clerk.json +769 -0
- package/locales/bg-BG/common.json +1 -0
- package/locales/bg-BG/error.json +8 -0
- package/locales/de-DE/auth.json +6 -0
- package/locales/de-DE/clerk.json +769 -0
- package/locales/de-DE/common.json +1 -0
- package/locales/de-DE/error.json +8 -0
- package/locales/en-US/auth.json +6 -0
- package/locales/en-US/clerk.json +769 -0
- package/locales/en-US/common.json +1 -0
- package/locales/en-US/error.json +8 -0
- package/locales/es-ES/auth.json +6 -0
- package/locales/es-ES/clerk.json +769 -0
- package/locales/es-ES/common.json +1 -0
- package/locales/es-ES/error.json +8 -0
- package/locales/fr-FR/auth.json +6 -0
- package/locales/fr-FR/clerk.json +769 -0
- package/locales/fr-FR/common.json +1 -0
- package/locales/fr-FR/error.json +8 -0
- package/locales/it-IT/auth.json +6 -0
- package/locales/it-IT/clerk.json +769 -0
- package/locales/it-IT/common.json +1 -0
- package/locales/it-IT/error.json +8 -0
- package/locales/ja-JP/auth.json +6 -0
- package/locales/ja-JP/clerk.json +769 -0
- package/locales/ja-JP/common.json +1 -0
- package/locales/ja-JP/error.json +8 -0
- package/locales/ko-KR/auth.json +6 -0
- package/locales/ko-KR/clerk.json +769 -0
- package/locales/ko-KR/common.json +1 -0
- package/locales/ko-KR/error.json +8 -0
- package/locales/nl-NL/auth.json +6 -0
- package/locales/nl-NL/clerk.json +769 -0
- package/locales/nl-NL/common.json +1 -0
- package/locales/nl-NL/error.json +8 -0
- package/locales/pl-PL/auth.json +6 -0
- package/locales/pl-PL/clerk.json +769 -0
- package/locales/pl-PL/common.json +1 -0
- package/locales/pl-PL/error.json +8 -0
- package/locales/pt-BR/auth.json +6 -0
- package/locales/pt-BR/clerk.json +769 -0
- package/locales/pt-BR/common.json +1 -0
- package/locales/pt-BR/error.json +8 -0
- package/locales/ru-RU/auth.json +6 -0
- package/locales/ru-RU/clerk.json +769 -0
- package/locales/ru-RU/common.json +1 -0
- package/locales/ru-RU/error.json +8 -0
- package/locales/tr-TR/auth.json +6 -0
- package/locales/tr-TR/clerk.json +769 -0
- package/locales/tr-TR/common.json +1 -0
- package/locales/tr-TR/error.json +8 -0
- package/locales/vi-VN/auth.json +6 -0
- package/locales/vi-VN/clerk.json +769 -0
- package/locales/vi-VN/common.json +1 -0
- package/locales/vi-VN/error.json +8 -0
- package/locales/zh-CN/auth.json +6 -0
- package/locales/zh-CN/clerk.json +769 -0
- package/locales/zh-CN/common.json +1 -0
- package/locales/zh-CN/error.json +8 -0
- package/locales/zh-TW/auth.json +6 -0
- package/locales/zh-TW/clerk.json +769 -0
- package/locales/zh-TW/common.json +1 -0
- package/locales/zh-TW/error.json +8 -0
- package/package.json +10 -5
- package/src/app/(auth)/layout.tsx +19 -0
- package/src/app/(auth)/login/[[...login]]/PageTitle.tsx +13 -0
- package/src/app/(auth)/login/[[...login]]/page.tsx +14 -0
- package/src/app/(auth)/profile/[[...slugs]]/PageTitle.tsx +13 -0
- package/src/app/(auth)/profile/[[...slugs]]/page.tsx +14 -0
- package/src/app/(auth)/signup/[[...signup]]/PageTitle.tsx +13 -0
- package/src/app/(auth)/signup/[[...signup]]/page.tsx +14 -0
- package/src/app/(main)/settings/common/features/Common.tsx +1 -1
- package/src/app/(main)/settings/common/features/Theme/index.tsx +2 -0
- package/src/app/(main)/settings/common/index.tsx +7 -3
- package/src/app/api/chat/[provider]/route.test.ts +76 -3
- package/src/app/api/chat/auth/index.test.ts +77 -0
- package/src/app/api/chat/auth/index.ts +19 -3
- package/src/app/api/chat/auth/utils.ts +31 -9
- package/src/app/api/plugin/gateway/route.ts +3 -3
- package/src/config/auth.ts +146 -0
- package/src/config/server/index.ts +1 -3
- package/src/const/auth.ts +7 -0
- package/src/features/AgentSetting/AgentMeta/AutoGenerateInput.tsx +1 -2
- package/src/features/AgentSetting/AgentMeta/AutoGenerateSelect.tsx +1 -1
- package/src/features/AgentSetting/AgentMeta/index.tsx +7 -2
- package/src/features/Conversation/Error/ClerkLogin/index.tsx +47 -0
- package/src/features/Conversation/Error/index.tsx +5 -0
- package/src/features/Conversation/components/InboxWelcome/index.tsx +4 -17
- package/src/features/DataImporter/index.tsx +2 -0
- package/src/features/User/UserAvatar.tsx +11 -5
- package/src/features/User/UserInfo.tsx +8 -7
- package/src/features/User/UserLoginOrSignup.tsx +23 -0
- package/src/features/User/UserPanel/PanelContent.tsx +74 -0
- package/src/features/User/UserPanel/UpgradeBadge.tsx +19 -0
- package/src/features/User/UserPanel/index.tsx +8 -27
- package/src/features/User/UserPanel/useMenu.tsx +49 -21
- package/src/features/User/__tests__/PanelContent.test.tsx +151 -0
- package/src/features/User/__tests__/UserAvatar.test.tsx +78 -0
- package/src/hooks/useGreeting/greetingTime.ts +14 -0
- package/src/hooks/useGreeting/index.ts +16 -0
- package/src/hooks/useTokenCount.ts +1 -0
- package/src/layout/AuthProvider/Clerk/UserUpdater.tsx +41 -0
- package/src/layout/AuthProvider/Clerk/index.tsx +26 -0
- package/src/layout/AuthProvider/Clerk/useAppearance.ts +118 -0
- package/src/layout/AuthProvider/index.tsx +8 -4
- package/src/layout/GlobalProvider/AppTheme.tsx +1 -1
- package/src/libs/next-auth/index.ts +4 -6
- package/src/libs/next-auth/sso-providers/auth0.ts +4 -6
- package/src/libs/next-auth/sso-providers/authentik.ts +4 -6
- package/src/libs/next-auth/sso-providers/azure-ad.ts +4 -6
- package/src/libs/next-auth/sso-providers/github.ts +3 -5
- package/src/libs/next-auth/sso-providers/zitadel.ts +4 -6
- package/src/locales/default/auth.ts +6 -0
- package/src/locales/default/clerk.ts +782 -0
- package/src/locales/default/common.ts +3 -0
- package/src/locales/default/error.ts +8 -0
- package/src/locales/default/index.ts +4 -0
- package/src/middleware.ts +19 -6
- package/src/server/globalConfig/index.ts +2 -2
- package/src/store/user/selectors.ts +1 -1
- package/src/store/user/slices/auth/action.test.ts +105 -0
- package/src/store/user/slices/auth/action.ts +40 -5
- package/src/store/user/slices/auth/initialState.ts +15 -0
- package/src/store/user/slices/auth/selectors.test.ts +127 -0
- package/src/store/user/slices/auth/selectors.ts +38 -1
- package/src/store/user/slices/settings/selectors/selectors.test.ts +25 -0
- package/src/store/user/slices/settings/selectors/settings.ts +6 -0
- package/src/styles/antdOverride.ts +5 -0
- package/src/types/fetch.ts +1 -0
- package/src/config/server/auth.ts +0 -71
- package/src/features/User/UserPanel/Popover.tsx +0 -35
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.154.1](https://github.com/lobehub/lobe-chat/compare/v0.154.0...v0.154.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2024-05-05**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Fix agent meta input disabled.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Fix agent meta input disabled, closes [#2381](https://github.com/lobehub/lobe-chat/issues/2381) ([d1fc512](https://github.com/lobehub/lobe-chat/commit/d1fc512))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 0.154.0](https://github.com/lobehub/lobe-chat/compare/v0.153.1...v0.154.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2024-05-05**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **misc**: Support clerk as auth provider.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **misc**: Support clerk as auth provider, closes [#2374](https://github.com/lobehub/lobe-chat/issues/2374) ([bf8ef1f](https://github.com/lobehub/lobe-chat/commit/bf8ef1f))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.153.1](https://github.com/lobehub/lobe-chat/compare/v0.153.0...v0.153.1)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2024-05-04**</sup>
|
|
@@ -1,40 +1,47 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
LobeChat Identity Verification Service - Centralized User Authorization
|
|
4
|
-
Management
|
|
2
|
+
title: LobeChat Authorization Service
|
|
5
3
|
description: >-
|
|
6
4
|
Learn about LobeChat's support for configuring external identity verification
|
|
7
5
|
services for centralized user authorization within enterprises/organizations.
|
|
8
6
|
Explore supported services like Auth0, Microsoft Entra ID, Authentik, Github,
|
|
9
7
|
and ZITADEL.
|
|
10
8
|
tags:
|
|
11
|
-
- Identity Verification Service
|
|
12
|
-
- Centralized User Authorization
|
|
13
9
|
- SSO Providers
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- Authentik
|
|
17
|
-
- Github
|
|
18
|
-
- ZITADEL
|
|
10
|
+
- Next Auth
|
|
11
|
+
- Clerk
|
|
19
12
|
---
|
|
20
13
|
|
|
21
|
-
#
|
|
14
|
+
# LobeChat Authorization
|
|
22
15
|
|
|
23
16
|
LobeChat supports the configuration of external identity verification services for internal use within enterprises/organizations to centrally manage user authorization.
|
|
24
17
|
|
|
25
|
-
|
|
18
|
+
## Clerk
|
|
19
|
+
|
|
20
|
+
Clerk is a comprehensive identity verification solution that has recently gained popularity. It provides a simple yet powerful API and services to handle user authentication and session management. Clerk's design philosophy is to offer a concise and modern authentication solution that enables developers to easily integrate and use it.
|
|
21
|
+
|
|
22
|
+
LobeChat has deeply integrated with Clerk to provide users with a more secure and convenient login and registration experience. It also relieves developers from the burden of managing authentication logic. Clerk's concise and modern design philosophy aligns perfectly with LobeChat's goals, making user management on the entire platform more efficient and reliable.
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
By setting the environment variables NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in LobeChat's environment, you can enable and use Clerk.
|
|
25
|
+
|
|
26
|
+
## Next Auth
|
|
27
|
+
|
|
28
|
+
Currently supported identity verification services include:
|
|
32
29
|
|
|
30
|
+
<Cards>
|
|
31
|
+
<Card href={'/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
|
32
|
+
<Card
|
|
33
|
+
href={'/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
|
34
|
+
title={'Microsoft Entra ID'}
|
|
35
|
+
/>
|
|
36
|
+
<Card href={'/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
|
37
|
+
<Card href={'/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
|
38
|
+
<Card href={'/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
|
39
|
+
</Cards>
|
|
33
40
|
Click on the links to view the corresponding platform's configuration documentation.
|
|
34
41
|
|
|
35
42
|
## Advanced Configuration
|
|
36
43
|
|
|
37
|
-
To simultaneously enable multiple identity verification sources, please set the `
|
|
44
|
+
To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,azure-ad,authentik`.
|
|
38
45
|
|
|
39
46
|
The order corresponds to the display order of the SSO providers.
|
|
40
47
|
|
|
@@ -1,36 +1,45 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: LobeChat
|
|
3
|
-
description:
|
|
4
|
-
了解如何配置外部身份验证服务以统一管理用户授权。支持的身份验证服务包括 Auth0, Microsoft Entra ID, Authentik,
|
|
5
|
-
Github, 和 ZITADEL。
|
|
2
|
+
title: LobeChat 身份验证服务配置
|
|
3
|
+
description: 了解如何使用 Clerk 或 Next Auth 配置外部身份验证服务,以统一管理用户授权。支持的身份验证服务包括 Auth0、 Azure ID 等。
|
|
6
4
|
tags:
|
|
7
5
|
- 身份验证服务
|
|
8
6
|
- LobeChat
|
|
9
7
|
- SSO
|
|
10
|
-
-
|
|
11
|
-
- Microsoft Entra ID
|
|
12
|
-
- Authentik
|
|
13
|
-
- Github
|
|
14
|
-
- ZITADEL
|
|
8
|
+
- Clerk
|
|
15
9
|
---
|
|
16
10
|
|
|
17
11
|
# 身份验证服务
|
|
18
12
|
|
|
19
|
-
LobeChat
|
|
13
|
+
LobeChat 支持使用 Clerk 或者 Next Auth 配置外部身份验证服务,供企业 / 组织内部使用,统一管理用户授权。
|
|
14
|
+
|
|
15
|
+
## Clerk
|
|
16
|
+
|
|
17
|
+
Clerk 是一个近期流行起来的全面的身份验证解决方案,它提供了简单而强大的 API 和服务来处理用户认证和会话管理。Clerk 的设计哲学是提供一套简洁、现代的认证解决方案,使得开发者可以轻松集成和使用。
|
|
18
|
+
|
|
19
|
+
LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全、便捷的登录和注册体验,同时也为开发者减轻了管理身份验证逻辑的负担。Clerk 的简洁和现代的设计理念与 LobeChat 的目标非常契合,使得整个平台的用户管理更加高效和可靠。
|
|
20
|
+
|
|
21
|
+
在 LobeChat 的环境变量中设置 `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY` 和 `CLERK_SECRET_KEY`,即可开启和使用 Clerk。
|
|
22
|
+
|
|
23
|
+
## Next Auth
|
|
20
24
|
|
|
21
25
|
目前支持的身份验证服务有:
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
<Cards>
|
|
28
|
+
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/auth0'} title={'Auth0'} />
|
|
29
|
+
<Card
|
|
30
|
+
href={'/zh/docs/self-hosting/advanced/sso-providers/microsoft-entra-id'}
|
|
31
|
+
title={'Microsoft Entra ID'}
|
|
32
|
+
/>
|
|
33
|
+
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/authentik'} title={'Authentik'} />
|
|
34
|
+
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/github'} title={'Github'} />
|
|
35
|
+
<Card href={'/zh/docs/self-hosting/advanced/sso-providers/zitadel'} title={'ZITADEL'} />
|
|
36
|
+
</Cards>
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
点击即可查看对应平台的配置文档。
|
|
30
39
|
|
|
31
40
|
## 进阶配置
|
|
32
41
|
|
|
33
|
-
同时启用多个身份验证源请设置 `
|
|
42
|
+
同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
|
|
34
43
|
|
|
35
44
|
顺序为 SSO 提供商的显示顺序。
|
|
36
45
|
|
|
@@ -14,8 +14,8 @@ tags:
|
|
|
14
14
|
|
|
15
15
|
LobeChat supports customizing the model list during deployment. You can use `+` to add a model, `-` to hide a model, and use `model name=display name<extension configuration>` to customize the display name of a model, separated by English commas. The basic syntax is as follows:
|
|
16
16
|
|
|
17
|
-
```
|
|
18
|
-
id=displayName
|
|
17
|
+
```text
|
|
18
|
+
id=displayName<maxToken:vision:fc:file>,model2,model3
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
For example: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
|
@@ -12,8 +12,8 @@ tags:
|
|
|
12
12
|
|
|
13
13
|
LobeChat 支持在部署时自定义模型列表,可以使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名<扩展配置>` 来自定义模型的展示名,用英文逗号隔开。通过 `<>` 来添加扩展配置。基本语法如下:
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
id=displayName
|
|
15
|
+
```text
|
|
16
|
+
id=displayName<maxToken:vision:fc:file>,model2,model3
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
例如: `+qwen-7b-chat,+glm-6b,-gpt-3.5-turbo,gpt-4-0125-preview=gpt-4-turbo`
|
|
@@ -5,150 +5,143 @@ description: >-
|
|
|
5
5
|
services in LobeChat, including OAuth SSO, NextAuth settings, and
|
|
6
6
|
provider-specific details.
|
|
7
7
|
tags:
|
|
8
|
-
- LobeChat
|
|
9
8
|
- Authentication Service
|
|
10
|
-
- Environment Variables
|
|
11
9
|
- OAuth SSO
|
|
10
|
+
- Clerk
|
|
12
11
|
- NextAuth
|
|
13
|
-
- Provider Details
|
|
14
12
|
---
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
# Authentication Service
|
|
17
15
|
|
|
18
16
|
LobeChat provides a complete authentication service capability when deployed. The following are the relevant environment variables. You can use these environment variables to easily define the identity verification services that need to be enabled in LobeChat.
|
|
19
17
|
|
|
20
|
-
##
|
|
18
|
+
## Next Auth
|
|
21
19
|
|
|
22
|
-
###
|
|
20
|
+
### General Settings
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
- Description: Enable single sign-on (SSO) for LobeChat. Set to `1` to enable single sign-on.
|
|
26
|
-
- Default: `-`
|
|
27
|
-
- Example: `1`
|
|
28
|
-
|
|
29
|
-
### `SSO_PROVIDERS`
|
|
30
|
-
|
|
31
|
-
- Type: Required
|
|
32
|
-
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
|
33
|
-
- Default: `auth0`
|
|
34
|
-
- Example: `auth0,azure-ad,authentik`
|
|
35
|
-
|
|
36
|
-
### `NEXTAUTH_SECRET`
|
|
22
|
+
#### `NEXTAUTH_SECRET`
|
|
37
23
|
|
|
38
24
|
- Type: Required
|
|
39
25
|
- Description: Key used to encrypt the session tokens in Auth.js. You can generate the key using the following command: `openssl rand -base64 32`.
|
|
40
26
|
- Default: `-`
|
|
41
27
|
- Example: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
|
42
28
|
|
|
43
|
-
|
|
29
|
+
#### `NEXTAUTH_URL`
|
|
44
30
|
|
|
45
31
|
- Type: Optional
|
|
46
32
|
- Description: This URL is used to specify the callback address for Auth.js during OAuth authentication. It does not need to be set when deploying on Vercel.
|
|
47
33
|
- Default: `-`
|
|
48
34
|
- Example: `https://example.com/api/auth`
|
|
49
35
|
|
|
50
|
-
|
|
36
|
+
#### `NEXT_AUTH_SSO_PROVIDERS`
|
|
37
|
+
|
|
38
|
+
- Type: Optional
|
|
39
|
+
- Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
|
|
40
|
+
- Default: `auth0`
|
|
41
|
+
- Example: `auth0,azure-ad,authentik`
|
|
42
|
+
|
|
43
|
+
### Auth0
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
#### `AUTH0_CLIENT_ID`
|
|
53
46
|
|
|
54
47
|
- Type: Required
|
|
55
48
|
- Description: Client ID of the Auth0 application. You can access it [here](https://manage.auth0.com/dashboard) and navigate to the application settings to view.
|
|
56
49
|
- Default: `-`
|
|
57
50
|
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
|
58
51
|
|
|
59
|
-
|
|
52
|
+
#### `AUTH0_CLIENT_SECRET`
|
|
60
53
|
|
|
61
54
|
- Type: Required
|
|
62
55
|
- Description: Client Secret of the Auth0 application.
|
|
63
56
|
- Default: `-`
|
|
64
57
|
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
|
65
58
|
|
|
66
|
-
|
|
59
|
+
#### `AUTH0_ISSUER`
|
|
67
60
|
|
|
68
61
|
- Type: Required
|
|
69
62
|
- Description: Issuer/domain of the Auth0 application.
|
|
70
63
|
- Default: `-`
|
|
71
64
|
- Example: `https://example.auth0.com`
|
|
72
65
|
|
|
73
|
-
|
|
66
|
+
### Microsoft Entra ID
|
|
74
67
|
|
|
75
|
-
|
|
68
|
+
#### `AZURE_AD_CLIENT_ID`
|
|
76
69
|
|
|
77
70
|
- Type: Required
|
|
78
71
|
- Description: Client ID of the Microsoft Entra ID application.
|
|
79
72
|
- Default: `-`
|
|
80
73
|
- Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
|
81
74
|
|
|
82
|
-
|
|
75
|
+
#### `AZURE_AD_CLIENT_SECRET`
|
|
83
76
|
|
|
84
77
|
- Type: Required
|
|
85
78
|
- Description: Client Secret of the Microsoft Entra ID application.
|
|
86
79
|
- Default: `-`
|
|
87
80
|
- Example: `~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
|
88
81
|
|
|
89
|
-
|
|
82
|
+
#### `AZURE_AD_TENANT_ID`
|
|
90
83
|
|
|
91
84
|
- Type: Required
|
|
92
85
|
- Description: Tenant ID of the Microsoft Entra ID application.
|
|
93
86
|
- Default: `-`
|
|
94
87
|
- Example: `c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
|
95
88
|
|
|
96
|
-
|
|
89
|
+
### Authentik
|
|
97
90
|
|
|
98
|
-
|
|
91
|
+
#### `AUTHENTIK_CLIENT_ID`
|
|
99
92
|
|
|
100
93
|
- Type: Required
|
|
101
94
|
- Description: Client ID of the Authentik provider application. You can access it [here][auth0-client-page] and navigate to the application settings to view.
|
|
102
95
|
- Default: `-`
|
|
103
96
|
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
|
104
97
|
|
|
105
|
-
|
|
98
|
+
#### `AUTHENTIK_CLIENT_SECRET`
|
|
106
99
|
|
|
107
100
|
- Type: Required
|
|
108
101
|
- Description: Client Secret of the Authentik provider application.
|
|
109
102
|
- Default: `-`
|
|
110
103
|
- Example: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
|
111
104
|
|
|
112
|
-
|
|
105
|
+
#### `AUTHENTIK_ISSUER`
|
|
113
106
|
|
|
114
107
|
- Type: Required
|
|
115
108
|
- Description: Issuer/domain of the Authentik provider application.
|
|
116
109
|
- Default: `-`
|
|
117
110
|
- Example: `https://your-authentik-domain.com/application/o/slug/`
|
|
118
111
|
|
|
119
|
-
|
|
112
|
+
### Github
|
|
120
113
|
|
|
121
|
-
|
|
114
|
+
#### `GITHUB_CLIENT_ID`
|
|
122
115
|
|
|
123
116
|
- Type: Required
|
|
124
117
|
- Description: Client ID of the Github application. You can access it [here](https://github.com/settings/apps) and navigate to the application settings to view.
|
|
125
118
|
- Default: `-`
|
|
126
119
|
- Example: `abd94200333283550508`
|
|
127
120
|
|
|
128
|
-
|
|
121
|
+
#### `GITHUB_CLIENT_SECRET`
|
|
129
122
|
|
|
130
123
|
- Type: Required
|
|
131
124
|
- Description: Client Secret of the Github application.
|
|
132
125
|
- Default: `-`
|
|
133
126
|
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
|
134
127
|
|
|
135
|
-
|
|
128
|
+
### ZITADEL
|
|
136
129
|
|
|
137
|
-
|
|
130
|
+
#### `ZITADEL_CLIENT_ID`
|
|
138
131
|
|
|
139
132
|
- Type: Required
|
|
140
133
|
- Description: Client ID of the ZITADEL application. This can be found under your application in the ZITADEL console.
|
|
141
134
|
- Default: `-`
|
|
142
135
|
- Example: `123456789012345678@your-project`
|
|
143
136
|
|
|
144
|
-
|
|
137
|
+
#### `ZITADEL_CLIENT_SECRET`
|
|
145
138
|
|
|
146
139
|
- Type: Required
|
|
147
140
|
- Description: Client Secret of the ZITADEL application.
|
|
148
141
|
- Default: `-`
|
|
149
142
|
- Example: `9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
|
150
143
|
|
|
151
|
-
|
|
144
|
+
#### `ZITADEL_ISSUER`
|
|
152
145
|
|
|
153
146
|
- Type: Required
|
|
154
147
|
- Description: Issuer of the ZITADEL application. This is usually the URL of the ZITADEL instance, and can be found in `URLs` tab of your application in the console.
|
|
@@ -160,3 +153,19 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
|
160
153
|
providers, you can submit a [feature
|
|
161
154
|
request](https://github.com/lobehub/lobe-chat/issues/new/choose) or Pull Request.
|
|
162
155
|
</Callout>
|
|
156
|
+
|
|
157
|
+
## Clerk
|
|
158
|
+
|
|
159
|
+
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
|
160
|
+
|
|
161
|
+
- Type: Required
|
|
162
|
+
- Description: Publishable key of the Clerk application. You can access it [here](https://dashboard.clerk.com) and navigate to the API Keys to view.
|
|
163
|
+
- Default: `-`
|
|
164
|
+
- Example: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` in dev / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` in production
|
|
165
|
+
|
|
166
|
+
### `CLERK_SECRET_KEY`
|
|
167
|
+
|
|
168
|
+
- Type: Required
|
|
169
|
+
- Description: Secret key of the Clerk application.
|
|
170
|
+
- Default: `-`
|
|
171
|
+
- Example: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` in dev / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ` in production
|
|
@@ -1,155 +1,145 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: LobeChat 身份验证服务设置
|
|
3
|
-
description:
|
|
4
|
-
了解如何配置 LobeChat 的身份验证服务环境变量,包括单点登录 (SSO)、Auth0、Microsoft Entra
|
|
5
|
-
ID、Authentik、Github 和 ZITADEL。
|
|
3
|
+
description: 了解如何配置 LobeChat 的身份验证服务环境变量。
|
|
6
4
|
tags:
|
|
7
5
|
- LobeChat
|
|
8
6
|
- 身份验证服务
|
|
9
7
|
- 单点登录
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Authentik
|
|
13
|
-
- Github
|
|
14
|
-
- ZITADEL
|
|
8
|
+
- Next Auth
|
|
9
|
+
- Clerk
|
|
15
10
|
---
|
|
16
11
|
|
|
17
12
|
# 身份验证服务
|
|
18
13
|
|
|
19
14
|
LobeChat 在部署时提供了完善的身份验证服务能力,以下是相关的环境变量,你可以使用这些环境变量轻松定义需要在 LobeChat 中开启的身份验证服务。
|
|
20
15
|
|
|
21
|
-
##
|
|
16
|
+
## Next Auth
|
|
22
17
|
|
|
23
|
-
###
|
|
18
|
+
### 通用设置
|
|
24
19
|
|
|
25
|
-
|
|
26
|
-
- 描述:为 LobeChat 启用单点登录 (SSO)。设置为 `1` 以启用单点登录。
|
|
27
|
-
- 默认值: `-`
|
|
28
|
-
- 示例: `1`
|
|
29
|
-
|
|
30
|
-
### `SSO_PROVIDERS`
|
|
31
|
-
|
|
32
|
-
- Type: 必需
|
|
33
|
-
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
|
34
|
-
- 默认值: `auth0`
|
|
35
|
-
- 示例: `auth0,azure-ad,authentik`
|
|
36
|
-
|
|
37
|
-
### `NEXTAUTH_SECRET`
|
|
20
|
+
#### `NEXTAUTH_SECRET`
|
|
38
21
|
|
|
39
22
|
- 类型:必选
|
|
40
23
|
- 描述:用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32`.
|
|
41
24
|
- 默认值: `-`
|
|
42
25
|
- 示例: `Tfhi2t2pelSMEA8eaV61KaqPNEndFFdMIxDaJnS1CUI=`
|
|
43
26
|
|
|
44
|
-
|
|
27
|
+
#### `NEXTAUTH_URL`
|
|
45
28
|
|
|
46
29
|
- 类型:可选
|
|
47
30
|
- 描述:该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,在 Vercel 上部署时无需设置。
|
|
48
31
|
- 默认值:`-`
|
|
49
32
|
- 示例:`https://example.com/api/auth`
|
|
50
33
|
|
|
51
|
-
|
|
34
|
+
#### `NEXT_AUTH_SSO_PROVIDERS`
|
|
52
35
|
|
|
53
|
-
|
|
36
|
+
- 类型:可选
|
|
37
|
+
- 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
|
|
38
|
+
- 默认值: `auth0`
|
|
39
|
+
- 示例: `auth0,azure-ad,authentik`
|
|
40
|
+
|
|
41
|
+
### Auth0
|
|
42
|
+
|
|
43
|
+
#### `AUTH0_CLIENT_ID`
|
|
54
44
|
|
|
55
45
|
- 类型:必选
|
|
56
46
|
- 描述: Auth0 应用程序的 Client ID,您可以访问[这里](https://manage.auth0.com/dashboard)并导航至应用程序设置来查看
|
|
57
47
|
- 默认值: `-`
|
|
58
48
|
- 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
|
59
49
|
|
|
60
|
-
|
|
50
|
+
#### `AUTH0_CLIENT_SECRET`
|
|
61
51
|
|
|
62
52
|
- 类型:必选
|
|
63
53
|
- 描述: Auth0 应用程序的 Client Secret
|
|
64
54
|
- 默认值: `-`
|
|
65
55
|
- 示例: `wnX7UbZg85ZUzF6ioxPLnJVEQa1Elbs7aqBUSF16xleBS5AdkVfASS49-fQIC8Rm`
|
|
66
56
|
|
|
67
|
-
|
|
57
|
+
#### `AUTH0_ISSUER`
|
|
68
58
|
|
|
69
59
|
- 类型:必选
|
|
70
60
|
- 描述: Auth0 应用程序的签发人 / 域
|
|
71
61
|
- 默认值: `-`
|
|
72
62
|
- 示例: `https://example.auth0.com`
|
|
73
63
|
|
|
74
|
-
|
|
64
|
+
### Microsoft Entra ID
|
|
75
65
|
|
|
76
|
-
|
|
66
|
+
#### `AZURE_AD_CLIENT_ID`
|
|
77
67
|
|
|
78
68
|
- 类型:必需
|
|
79
69
|
- 描述:Microsoft Entra ID 应用程序的客户端 ID。
|
|
80
70
|
- 默认值:`-`
|
|
81
71
|
- 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
|
82
72
|
|
|
83
|
-
|
|
73
|
+
#### `AZURE_AD_CLIENT_SECRET`
|
|
84
74
|
|
|
85
75
|
- 类型:必需
|
|
86
76
|
- 描述:Microsoft Entra ID 应用程序的客户端密钥。
|
|
87
77
|
- 默认值:`-`
|
|
88
78
|
- 示例:`~gI8Q.pTiN1vwB6Gl.E1yFT1ojcXABkdACfJXaNj`
|
|
89
79
|
|
|
90
|
-
|
|
80
|
+
#### `AZURE_AD_TENANT_ID`
|
|
91
81
|
|
|
92
82
|
- 类型:必需
|
|
93
83
|
- 描述:Microsoft Entra ID 应用程序的租户 ID。
|
|
94
84
|
- 默认值:`-`
|
|
95
85
|
- 示例:`c8ae2f36-edf6-4cda-96b9-d3e198a47cba`
|
|
96
86
|
|
|
97
|
-
|
|
87
|
+
### Authentik
|
|
98
88
|
|
|
99
|
-
|
|
89
|
+
#### `AUTHENTIK_CLIENT_ID`
|
|
100
90
|
|
|
101
91
|
- 类型:必选
|
|
102
92
|
- 描述: Authentik 提供程序的 Client ID
|
|
103
93
|
- 默认值: `-`
|
|
104
94
|
- 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
|
|
105
95
|
|
|
106
|
-
|
|
96
|
+
#### `AUTHENTIK_CLIENT_SECRET`
|
|
107
97
|
|
|
108
98
|
- 类型:必选
|
|
109
99
|
- 描述: Authentik 提供程序的 Client Secret
|
|
110
100
|
- 默认值: `-`
|
|
111
101
|
- 示例: `h3lMI1vPUzqyqqeIDUbH5UNNOxyQLXk35h89yETeaAwHk7qVXBG3sJQWeqHBU5pyggwhP9u0eaZ1eq6DHUddVPLoS4gncqD37yuCr8jI8dY66WAt45MStDsDcQm0Ygze`
|
|
112
102
|
|
|
113
|
-
|
|
103
|
+
#### `AUTHENTIK_ISSUER`
|
|
114
104
|
|
|
115
105
|
- 类型:必选
|
|
116
106
|
- 描述: Authentik 提供程序的 OpenID Connect 颁发者
|
|
117
107
|
- 默认值: `-`
|
|
118
108
|
- 示例: `https://your-authentik-domain.com/application/o/slug/`
|
|
119
109
|
|
|
120
|
-
|
|
110
|
+
### Github
|
|
121
111
|
|
|
122
|
-
|
|
112
|
+
#### `GITHUB_CLIENT_ID`
|
|
123
113
|
|
|
124
114
|
- Type: Required
|
|
125
115
|
- Description: Github应用的客户端ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
|
|
126
116
|
- Default: `-`
|
|
127
117
|
- Example: `abd94200333283550508`
|
|
128
118
|
|
|
129
|
-
|
|
119
|
+
#### `GITHUB_CLIENT_SECRET`
|
|
130
120
|
|
|
131
121
|
- Type: Required
|
|
132
122
|
- Description: Github应用的客户端密钥。
|
|
133
123
|
- Default: `-`
|
|
134
124
|
- Example: `dd262976ac0931d947e104891586a053f3d3750b`
|
|
135
125
|
|
|
136
|
-
|
|
126
|
+
### ZITADEL
|
|
137
127
|
|
|
138
|
-
|
|
128
|
+
#### `ZITADEL_CLIENT_ID`
|
|
139
129
|
|
|
140
130
|
- 类型:必选
|
|
141
131
|
- 描述:ZITADEL 应用的 Client ID。您可以在 ZITADEL 控制台应用设置中找到 Client ID。
|
|
142
132
|
- 默认值:`-`
|
|
143
133
|
- 示例:`123456789012345678@your-project`
|
|
144
134
|
|
|
145
|
-
|
|
135
|
+
#### `ZITADEL_CLIENT_SECRET`
|
|
146
136
|
|
|
147
137
|
- 类型:必选
|
|
148
138
|
- 描述:ZITADEL 应用的 Client Secret。
|
|
149
139
|
- 默认值:`-`
|
|
150
140
|
- 示例:`9QF1n5ATzU7Z3mHp2Iw4gKX8kY6oR7uW1DnKcV3LqX2jF6iG3fBmJ1kV7nS5zE6A`
|
|
151
141
|
|
|
152
|
-
|
|
142
|
+
#### `ZITADEL_ISSUER`
|
|
153
143
|
|
|
154
144
|
- 类型:必选
|
|
155
145
|
- 描述:ZITADEL 应用的 OpenID Connect 颁发者(issuer),通常为 ZITADEL 实例的 URL。您可以在 ZITADEL 控制台应用设置中的 `URLs` 选项卡中找到 issuer。
|
|
@@ -160,3 +150,19 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
|
160
150
|
如果您需要使用其他身份验证服务提供商,可以提交
|
|
161
151
|
[功能请求](https://github.com/lobehub/lobe-chat/issues/new/choose) 或 Pull Request。
|
|
162
152
|
</Callout>
|
|
153
|
+
|
|
154
|
+
## Clerk
|
|
155
|
+
|
|
156
|
+
### `NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`
|
|
157
|
+
|
|
158
|
+
- 类型:必选
|
|
159
|
+
- 描述: Clerk 应用程序的 Publishable key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
|
160
|
+
- 默认值:`-`
|
|
161
|
+
- 示例: `pk_test_Zmxvd4luZy1wdW1hLTIyLmNsXXJrTmFjY291bnRzLmRldiQ` (测试环境) / `pk_live_Y2xlcdsubG9iZWh1Yi1cbmMuY24k` (生产环境)
|
|
162
|
+
|
|
163
|
+
### `CLERK_SECRET_KEY`
|
|
164
|
+
|
|
165
|
+
- 类型:必选
|
|
166
|
+
- 描述: Clerk 应用程序的 Secret key。您可以在[这里](https://dashboard.clerk.com)访问,并导航到 API Keys 以查看。
|
|
167
|
+
- 默认值:`-`
|
|
168
|
+
- 示例: `sk_test_513Ma0P7IAWM1XMv4waxZjRYRajWTaCfJLjpEO3SD2` (测试环境) / `sk_live_eMMlHjwJvZFUfczFljSKqZdwQtLvmczmsJSNmdrpeZ`(生产环境)
|