@lobehub/chat 1.105.5 → 1.106.0
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/changelog/v1.json +18 -0
- package/docs/self-hosting/advanced/auth/next-auth/okta.mdx +65 -0
- package/docs/self-hosting/advanced/auth/next-auth/okta.zh-CN.mdx +63 -0
- package/docs/self-hosting/advanced/auth.mdx +3 -0
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +3 -0
- package/docs/self-hosting/environment-variables/auth.mdx +23 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +23 -0
- package/package.json +1 -1
- package/src/app/[variants]/(main)/chat/@session/features/SessionListContent/Inbox/index.tsx +17 -2
- package/src/libs/next-auth/sso-providers/index.ts +4 -2
- package/src/libs/next-auth/sso-providers/okta.ts +26 -0
- package/src/store/chat/slices/message/selectors.ts +6 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
## [Version 1.106.0](https://github.com/lobehub/lobe-chat/compare/v1.105.6...v1.106.0)
|
6
|
+
|
7
|
+
<sup>Released on **2025-07-29**</sup>
|
8
|
+
|
9
|
+
#### ✨ Features
|
10
|
+
|
11
|
+
- **misc**: Add support for Okta Authentication.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's improved
|
19
|
+
|
20
|
+
- **misc**: Add support for Okta Authentication, closes [#8547](https://github.com/lobehub/lobe-chat/issues/8547) ([67abdfe](https://github.com/lobehub/lobe-chat/commit/67abdfe))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.105.6](https://github.com/lobehub/lobe-chat/compare/v1.105.5...v1.105.6)
|
31
|
+
|
32
|
+
<sup>Released on **2025-07-29**</sup>
|
33
|
+
|
34
|
+
#### 💄 Styles
|
35
|
+
|
36
|
+
- **misc**: Open new topic by tap Just Chat again.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Styles
|
44
|
+
|
45
|
+
- **misc**: Open new topic by tap Just Chat again, closes [#8426](https://github.com/lobehub/lobe-chat/issues/8426) ([018ca75](https://github.com/lobehub/lobe-chat/commit/018ca75))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.105.5](https://github.com/lobehub/lobe-chat/compare/v1.105.4...v1.105.5)
|
6
56
|
|
7
57
|
<sup>Released on **2025-07-29**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"features": [
|
5
|
+
"Add support for Okta Authentication."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-07-29",
|
9
|
+
"version": "1.106.0"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Open new topic by tap Just Chat again."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-07-29",
|
18
|
+
"version": "1.105.6"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"fixes": [
|
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
title: Configure Okta Identity Verification Service for LobeChat
|
3
|
+
description: >-
|
4
|
+
Learn how to configure Okta Identity Verification Service for LobeChat for your organization, including creating applications, adding users, and configuring environment variables.
|
5
|
+
|
6
|
+
tags:
|
7
|
+
- Okta
|
8
|
+
- Identity Verification
|
9
|
+
- Single Sign-On
|
10
|
+
- Environment Variables
|
11
|
+
- User Management
|
12
|
+
- SSO Integrations
|
13
|
+
- Social Login
|
14
|
+
---
|
15
|
+
|
16
|
+
# Configure Okta Identity Verification Service
|
17
|
+
|
18
|
+
<Steps>
|
19
|
+
### Create Okta Application
|
20
|
+
|
21
|
+
Register and log in to [Okta][okta-client-page], open the "Applications" subtab in the left navigation bar, and click "Applications" to switch to the application management interface. click "Create App Integration" in the upper left corner to create an application.
|
22
|
+
|
23
|
+
Select "OIDC - OpenID Connect" in Sign-In Method and then select "Web Application" in Application Type.
|
24
|
+
|
25
|
+
Fill in the following settings:
|
26
|
+
|
27
|
+
| Setting Name | Description | Sample Information |
|
28
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------ | --------------------------------------------- |
|
29
|
+
| App Integration Name | The Application Name your users will see | LobeChat Instance |
|
30
|
+
| Sign-in redirect URIs | Okta sends the authentication response and ID token for the user's sign-in request to these URIs | (http(s)://your-domain/api/auth/callback/okta |
|
31
|
+
| Sign-out redirect URIs | After your application contacts Okta to close the user session, Okta redirects the user to one of these URIs | (http(s)://your-domain |
|
32
|
+
|
33
|
+
<Callout type={'important'}>
|
34
|
+
You can fill in or modify all the fields after deployment, but make sure the filled URL is
|
35
|
+
consistent with the deployed URL.
|
36
|
+
</Callout>
|
37
|
+
|
38
|
+
### Add Users
|
39
|
+
|
40
|
+
Click on the "Assignments" in the top navigation bar to enter the user management interface, where you can create or assign users in your organization to log in to LobeChat.
|
41
|
+
|
42
|
+
### Configure Environment Variables
|
43
|
+
|
44
|
+
When deploying LobeChat, you need to configure the following environment variables:
|
45
|
+
|
46
|
+
| Environment Variable | Type | Description |
|
47
|
+
| ------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
48
|
+
| `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate a key using the following command: `openssl rand -base64 32` |
|
49
|
+
| `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `okta` for Okta. |
|
50
|
+
| `AUTH_OKTA_ID` | Required | Client ID of the Okta application |
|
51
|
+
| `AUTH_OKTA_SECRET` | Required | Client Secret of the Okta application |
|
52
|
+
| `AUTH_OKTA_ISSUER` | Required | Domain of the Okta application, `https://example.oktapreview.com` |
|
53
|
+
| `NEXTAUTH_URL` | Optional | The URL is used to specify the callback address for the execution of OAuth authentication in Auth.js. It needs to be set only when the default address is incorrect. `https://example.com/api/auth` |
|
54
|
+
|
55
|
+
<Callout type={'tip'}>
|
56
|
+
You can refer to the related variable details at [📘Environment Variables](/docs/self-hosting/environment-variable/auth#okta).
|
57
|
+
</Callout>
|
58
|
+
</Steps>
|
59
|
+
|
60
|
+
<Callout>
|
61
|
+
After successful deployment, users will be able to authenticate and use LobeChat using the users
|
62
|
+
configured in Okta.
|
63
|
+
</Callout>
|
64
|
+
|
65
|
+
[okta-client-page]: https://login.okta.com
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
title: 在 LobeChat 中配置 Okta 身份验证服务 - 详细步骤和环境变量设置
|
3
|
+
description: >-
|
4
|
+
学习如何在 LobeChat 中为您的组织配置 Okta 身份验证服务,包括创建应用程序、添加用户和配置环境变量等。
|
5
|
+
|
6
|
+
tags:
|
7
|
+
- Okta
|
8
|
+
- 身份验证
|
9
|
+
- 单点登录
|
10
|
+
- 环境变量
|
11
|
+
- 用户管理
|
12
|
+
- SSO 集成
|
13
|
+
- 社交登录
|
14
|
+
---
|
15
|
+
|
16
|
+
# 配置 Okta 身份验证服务
|
17
|
+
|
18
|
+
<Steps>
|
19
|
+
### 创建 Okta 应用程序
|
20
|
+
|
21
|
+
注册并登录 [Okta][okta-client-page],打开左侧导航栏中的「Applications」子选项卡,点击「Applications」切换到应用程序管理界面。点击左上角的「Create App Integration」创建应用程序。
|
22
|
+
|
23
|
+
在登录方法中选择「OIDC - OpenID Connect」,然后在应用程序类型中选择「Web Application」。
|
24
|
+
|
25
|
+
填写以下设置:
|
26
|
+
|
27
|
+
| 设置名称 | 描述 | 示例信息 |
|
28
|
+
| ---------------------- | ------------------------------------------- | --------------------------------------------- |
|
29
|
+
| App Integration Name | 您的用户将看到的应用程序名称 | LobeChat Instance |
|
30
|
+
| Sign-in redirect URIs | Okta 将用户登录请求的身份验证响应和 ID 令牌发送到这些 URI | (http(s)://your-domain/api/auth/callback/okta |
|
31
|
+
| Sign-out redirect URIs | 您的应用程序联系 Okta 关闭用户会话后,Okta 将用户重定向到这些 URI 之一 | (http(s)://your-domain |
|
32
|
+
|
33
|
+
<Callout type={'important'}>
|
34
|
+
您可以在部署后填写或修改所有字段,但请确保填写的 URL 与部署的 URL 一致。
|
35
|
+
</Callout>
|
36
|
+
|
37
|
+
### 添加用户
|
38
|
+
|
39
|
+
点击顶部导航栏中的「Assignments」进入用户管理界面,您可以在此创建或分配组织中的用户来登录 LobeChat。
|
40
|
+
|
41
|
+
### 配置环境变量
|
42
|
+
|
43
|
+
在部署 LobeChat 时,您需要配置以下环境变量:
|
44
|
+
|
45
|
+
| 环境变量 | 类型 | 描述 |
|
46
|
+
| ------------------------- | -- | ------------------------------------------------------------------------------------ |
|
47
|
+
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成密钥:`openssl rand -base64 32` |
|
48
|
+
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Okta 请填写 `okta`。 |
|
49
|
+
| `AUTH_OKTA_ID` | 必选 | Okta 应用程序的客户端 ID |
|
50
|
+
| `AUTH_OKTA_SECRET` | 必选 | Okta 应用程序的客户端密钥 |
|
51
|
+
| `AUTH_OKTA_ISSUER` | 必选 | Okta 应用程序的域名,`https://example.oktapreview.com` |
|
52
|
+
| `NEXTAUTH_URL` | 可选 | 该 URL 用于指定 Auth.js 在执行 OAuth 认证时的回调地址。仅当默认地址不正确时才需要设置。`https://example.com/api/auth` |
|
53
|
+
|
54
|
+
<Callout type={'tip'}>
|
55
|
+
您可以在 [📘环境变量](/zh/docs/self-hosting/environment-variables/auth#okta) 查阅相关变量详情。
|
56
|
+
</Callout>
|
57
|
+
</Steps>
|
58
|
+
|
59
|
+
<Callout>
|
60
|
+
部署成功后,用户将能够使用在 Okta 中配置的用户进行身份验证并使用 LobeChat。
|
61
|
+
</Callout>
|
62
|
+
|
63
|
+
[okta-client-page]: https://login.okta.com
|
@@ -55,6 +55,8 @@ Currently supported identity verification services include:
|
|
55
55
|
<Card href={'/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />
|
56
56
|
|
57
57
|
<Card href={'/docs/self-hosting/advanced/auth/next-auth/google'} title={'Google'} />
|
58
|
+
|
59
|
+
<Card href={'/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />
|
58
60
|
</Cards>
|
59
61
|
|
60
62
|
Click on the links to view the corresponding platform's configuration documentation.
|
@@ -78,6 +80,7 @@ The order corresponds to the display order of the SSO providers.
|
|
78
80
|
| ZITADEL | `zitadel` |
|
79
81
|
| Keycloak | `keycloak` |
|
80
82
|
| Google | `google` |
|
83
|
+
| Okta | `okta` |
|
81
84
|
|
82
85
|
## Other SSO Providers
|
83
86
|
|
@@ -51,6 +51,8 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
|
|
51
51
|
<Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/logto'} title={'Logto'} />
|
52
52
|
|
53
53
|
<Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/keycloak'} title={'Keycloak'} />
|
54
|
+
|
55
|
+
<Card href={'/zh/docs/self-hosting/advanced/auth/next-auth/okta'} title={'Okta'} />
|
54
56
|
</Cards>
|
55
57
|
|
56
58
|
点击即可查看对应平台的配置文档。
|
@@ -73,6 +75,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
|
|
73
75
|
| Microsoft Entra ID | `microsoft-entra-id` |
|
74
76
|
| ZITADEL | `zitadel` |
|
75
77
|
| Keycloak | `keycloak` |
|
78
|
+
| Okta | `okta` |
|
76
79
|
|
77
80
|
## 其他 SSO 提供商
|
78
81
|
|
@@ -249,6 +249,29 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
249
249
|
- Default: `-`
|
250
250
|
- Example: `https://your-instance-abc123.zitadel.cloud`
|
251
251
|
|
252
|
+
### Okta
|
253
|
+
|
254
|
+
#### `AUTH_OKTA_ID`
|
255
|
+
|
256
|
+
- Type: Required
|
257
|
+
- Description: Client ID of the Okta application. This can be found under your application settings in the Okta console.
|
258
|
+
- Default: `-`
|
259
|
+
- Example: `ac12c950f3ce48c8a45a`
|
260
|
+
|
261
|
+
#### `AUTH_OKTA_SECRET`
|
262
|
+
|
263
|
+
- Type: Required
|
264
|
+
- Description: Client Secret of the Okta application. This can be found under your application settings in the Okta console.
|
265
|
+
- Default: `-`
|
266
|
+
- Example: `ex1HqvSOOkC5INqo42grOSqNvHoD4p84em1yy5QU7v88IZlaWGywFjYkrkpkSopt`
|
267
|
+
|
268
|
+
#### `AUTH_OKTA_ISSUER`
|
269
|
+
|
270
|
+
- Type: Required
|
271
|
+
- Description: Issuer of the Okta application. This is the URL of the Okta instance -- If branding is set up, it can be your custom domain.
|
272
|
+
- Default: `-`
|
273
|
+
- Example: `https://your-instance.okta.com`
|
274
|
+
|
252
275
|
### Generic OIDC
|
253
276
|
|
254
277
|
#### `AUTH_GENERIC_OIDC_ID`
|
@@ -245,6 +245,29 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
245
245
|
- 默认值:`-`
|
246
246
|
- 示例:`https://your-instance-abc123.zitadel.cloud`
|
247
247
|
|
248
|
+
### Okta
|
249
|
+
|
250
|
+
#### `AUTH_OKTA_ID`
|
251
|
+
|
252
|
+
- 类型:必选
|
253
|
+
- 描述:Okta 应用程序的 Client ID。您可以在 Okta 控制台的应用程序设置中找到。
|
254
|
+
- 默认值:`-`
|
255
|
+
- 示例:`ac12c950f3ce48c8a45a`
|
256
|
+
|
257
|
+
#### `AUTH_OKTA_SECRET`
|
258
|
+
|
259
|
+
- 类型:必选
|
260
|
+
- 描述:Okta 应用程序的 Client Secret。您可以在 Okta 控制台的应用程序设置中找到。
|
261
|
+
- 默认值:`-`
|
262
|
+
- 示例:`ex1HqvSOOkC5INqo42grOSqNvHoD4p84em1yy5QU7v88IZlaWGywFjYkrkpkSopt`
|
263
|
+
|
264
|
+
#### `AUTH_OKTA_ISSUER`
|
265
|
+
|
266
|
+
- 类型:必选
|
267
|
+
- 描述:Okta 应用程序的 OpenID Connect 颁发者(issuer)。这是 Okta 实例的 URL—— 如果设置了品牌化,也可以是您的自定义域名。
|
268
|
+
- 默认值:`-`
|
269
|
+
- 示例:`https://your-instance.okta.com`
|
270
|
+
|
248
271
|
### Generic OIDC
|
249
272
|
|
250
273
|
#### `AUTH_GENERIC_OIDC_ID`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.106.0",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -6,6 +6,8 @@ import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
|
|
6
6
|
import { INBOX_SESSION_ID } from '@/const/session';
|
7
7
|
import { SESSION_CHAT_URL } from '@/const/url';
|
8
8
|
import { useSwitchSession } from '@/hooks/useSwitchSession';
|
9
|
+
import { getChatStoreState, useChatStore } from '@/store/chat';
|
10
|
+
import { chatSelectors } from '@/store/chat/selectors';
|
9
11
|
import { useServerConfigStore } from '@/store/serverConfig';
|
10
12
|
import { useSessionStore } from '@/store/session';
|
11
13
|
|
@@ -17,13 +19,26 @@ const Inbox = memo(() => {
|
|
17
19
|
const activeId = useSessionStore((s) => s.activeId);
|
18
20
|
const switchSession = useSwitchSession();
|
19
21
|
|
22
|
+
const openNewTopicOrSaveTopic = useChatStore((s) => s.openNewTopicOrSaveTopic);
|
23
|
+
|
20
24
|
return (
|
21
25
|
<Link
|
22
26
|
aria-label={t('inbox.title')}
|
23
27
|
href={SESSION_CHAT_URL(INBOX_SESSION_ID, mobile)}
|
24
|
-
onClick={(e) => {
|
28
|
+
onClick={async (e) => {
|
25
29
|
e.preventDefault();
|
26
|
-
|
30
|
+
|
31
|
+
if (activeId === INBOX_SESSION_ID && !mobile) {
|
32
|
+
// If user tap the inbox again, open a new topic.
|
33
|
+
// Only for desktop.
|
34
|
+
const inboxMessages = chatSelectors.inboxActiveTopicMessages(getChatStoreState());
|
35
|
+
|
36
|
+
if (inboxMessages.length > 0) {
|
37
|
+
await openNewTopicOrSaveTopic();
|
38
|
+
}
|
39
|
+
} else {
|
40
|
+
switchSession(INBOX_SESSION_ID);
|
41
|
+
}
|
27
42
|
}}
|
28
43
|
>
|
29
44
|
<ListItem
|
@@ -4,15 +4,16 @@ import Authentik from './authentik';
|
|
4
4
|
import AzureAD from './azure-ad';
|
5
5
|
import Casdoor from './casdoor';
|
6
6
|
import CloudflareZeroTrust from './cloudflare-zero-trust';
|
7
|
+
import Cognito from './cognito';
|
7
8
|
import GenericOIDC from './generic-oidc';
|
8
9
|
import Github from './github';
|
9
10
|
import Google from './google';
|
10
11
|
import Keycloak from './keycloak';
|
11
12
|
import Logto from './logto';
|
12
13
|
import MicrosoftEntraID from './microsoft-entra-id';
|
14
|
+
import Okta from './okta';
|
13
15
|
import WeChat from './wechat';
|
14
16
|
import Zitadel from './zitadel';
|
15
|
-
import Cognito from "./cognito";
|
16
17
|
|
17
18
|
export const ssoProviders = [
|
18
19
|
Auth0,
|
@@ -29,5 +30,6 @@ export const ssoProviders = [
|
|
29
30
|
WeChat,
|
30
31
|
Keycloak,
|
31
32
|
Google,
|
32
|
-
Cognito
|
33
|
+
Cognito,
|
34
|
+
Okta,
|
33
35
|
];
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import Okta from 'next-auth/providers/okta';
|
2
|
+
|
3
|
+
import { CommonProviderConfig } from './sso.config';
|
4
|
+
|
5
|
+
const provider = {
|
6
|
+
id: 'okta',
|
7
|
+
provider: Okta({
|
8
|
+
...CommonProviderConfig,
|
9
|
+
authorization: { params: { scope: 'openid email profile' } },
|
10
|
+
clientId: process.env.AUTH_OKTA_ID,
|
11
|
+
clientSecret: process.env.AUTH_OKTA_SECRET,
|
12
|
+
issuer: process.env.AUTH_OKTA_ISSUER,
|
13
|
+
// Remove End
|
14
|
+
profile(profile) {
|
15
|
+
return {
|
16
|
+
email: profile.email,
|
17
|
+
id: profile.sub,
|
18
|
+
image: profile.picture,
|
19
|
+
name: profile.name ?? profile.preferred_username,
|
20
|
+
providerAccountId: profile.sub,
|
21
|
+
};
|
22
|
+
},
|
23
|
+
}),
|
24
|
+
};
|
25
|
+
|
26
|
+
export default provider;
|
@@ -201,6 +201,11 @@ const isSendButtonDisabledByMessage = (s: ChatStoreState) =>
|
|
201
201
|
// 4. when the message is in RAG flow
|
202
202
|
isInRAGFlow(s);
|
203
203
|
|
204
|
+
const inboxActiveTopicMessages = (state: ChatStoreState) => {
|
205
|
+
const activeTopicId = state.activeTopicId;
|
206
|
+
return state.messagesMap[messageMapKey(INBOX_SESSION_ID, activeTopicId)] || [];
|
207
|
+
};
|
208
|
+
|
204
209
|
export const chatSelectors = {
|
205
210
|
activeBaseChats,
|
206
211
|
activeBaseChatsWithoutTool,
|
@@ -213,6 +218,7 @@ export const chatSelectors = {
|
|
213
218
|
getMessageById,
|
214
219
|
getMessageByToolCallId,
|
215
220
|
getTraceIdByMessageId,
|
221
|
+
inboxActiveTopicMessages,
|
216
222
|
isAIGenerating,
|
217
223
|
isCreatingMessage,
|
218
224
|
isCurrentChatLoaded,
|