@lobehub/chat 1.22.10 → 1.22.11

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 CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.22.11](https://github.com/lobehub/lobe-chat/compare/v1.22.10...v1.22.11)
6
+
7
+ <sup>Released on **2024-10-20**</sup>
8
+
9
+ #### ♻ Code Refactoring
10
+
11
+ - **misc**: Refactor azure ad to ms entra id.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Code refactoring
19
+
20
+ - **misc**: Refactor azure ad to ms entra id, closes [#4168](https://github.com/lobehub/lobe-chat/issues/4168) ([4fa9588](https://github.com/lobehub/lobe-chat/commit/4fa9588))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 1.22.10](https://github.com/lobehub/lobe-chat/compare/v1.22.9...v1.22.10)
6
31
 
7
32
  <sup>Released on **2024-10-20**</sup>
package/README.md CHANGED
@@ -68,7 +68,7 @@ One-click **FREE** deployment of your private OpenAI ChatGPT/Claude/Gemini/Groq/
68
68
  - [`*` What's more](#-whats-more)
69
69
  - [⚡️ Performance](#️-performance)
70
70
  - [🛳 Self Hosting](#-self-hosting)
71
- - [`A` Deploying with Vercel, Zeabur or Sealos](#a-deploying-with-vercel-zeabur-or-sealos)
71
+ - [`A` Deploying with Vercel, Zeabur , Sealos or Alibaba Cloud](#a-deploying-with-vercel-zeabur--sealos-or-alibaba-cloud)
72
72
  - [`B` Deploying with Docker](#b-deploying-with-docker)
73
73
  - [Environment Variable](#environment-variable)
74
74
  - [📦 Ecosystem](#-ecosystem)
@@ -457,7 +457,7 @@ LobeChat provides Self-Hosted Version with Vercel, Alibaba Cloud, and [Docker Im
457
457
  <div align="center">
458
458
 
459
459
  | Deploy with Vercel | Deploy with Zeabur | Deploy with Sealos | Deploy with RepoCloud | Deploy with Alibaba Cloud |
460
- |:---------------------------------------:|:-----------------------------------------------------------:|:-----------------------------------------------------------:|:-----------------------------------------------------------------:|:-------------------------------------------------------------------------:|
460
+ | :-------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------: | :---------------------------------------------------------------: | :-----------------------------------------------------------------------: |
461
461
  | [![][deploy-button-image]][deploy-link] | [![][deploy-on-zeabur-button-image]][deploy-on-zeabur-link] | [![][deploy-on-sealos-button-image]][deploy-on-sealos-link] | [![][deploy-on-repocloud-button-image]][deploy-on-repocloud-link] | [![][deploy-on-alibaba-cloud-button-image]][deploy-on-alibaba-cloud-link] |
462
462
 
463
463
  </div>
@@ -705,14 +705,14 @@ This project is [Apache 2.0](./LICENSE) licensed.
705
705
  [codespaces-shield]: https://github.com/codespaces/badge.svg
706
706
  [deploy-button-image]: https://vercel.com/button
707
707
  [deploy-link]: https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Flobehub%2Flobe-chat&env=OPENAI_API_KEY,ACCESS_CODE&envDescription=Find%20your%20OpenAI%20API%20Key%20by%20click%20the%20right%20Learn%20More%20button.%20%7C%20Access%20Code%20can%20protect%20your%20website&envLink=https%3A%2F%2Fplatform.openai.com%2Faccount%2Fapi-keys&project-name=lobe-chat&repository-name=lobe-chat
708
+ [deploy-on-alibaba-cloud-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg
709
+ [deploy-on-alibaba-cloud-link]: https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=LobeChat%E7%A4%BE%E5%8C%BA%E7%89%88
708
710
  [deploy-on-repocloud-button-image]: https://d16t0pc4846x52.cloudfront.net/deploylobe.svg
709
711
  [deploy-on-repocloud-link]: https://repocloud.io/details/?app_id=248
710
712
  [deploy-on-sealos-button-image]: https://raw.githubusercontent.com/labring-actions/templates/main/Deploy-on-Sealos.svg
711
713
  [deploy-on-sealos-link]: https://cloud.sealos.io/?openapp=system-template%3FtemplateName%3Dlobe-chat
712
714
  [deploy-on-zeabur-button-image]: https://zeabur.com/button.svg
713
715
  [deploy-on-zeabur-link]: https://zeabur.com/templates/VZGGTI
714
- [deploy-on-alibaba-cloud-button-image]: https://service-info-public.oss-cn-hangzhou.aliyuncs.com/computenest-en.svg
715
- [deploy-on-alibaba-cloud-link]: https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=LobeChat%E7%A4%BE%E5%8C%BA%E7%89%88
716
716
  [discord-link]: https://discord.gg/AYFPHvv2jT
717
717
  [discord-shield]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=flat-square
718
718
  [discord-shield-badge]: https://img.shields.io/discord/1127171173982154893?color=5865F2&label=discord&labelColor=black&logo=discord&logoColor=white&style=for-the-badge
@@ -25,7 +25,7 @@ Fill in the desired application name to be displayed to organizational users, ch
25
25
  In the `Redirect URI (optional)` section, for the application type, select `Web`, and in the Callback URL, enter:
26
26
 
27
27
  ```bash
28
- https://your-domain/api/auth/callback/azure-ad
28
+ https://your-domain/api/auth/callback/microsoft-entra-id
29
29
  ```
30
30
 
31
31
  <Callout type={'info'}>
@@ -72,10 +72,10 @@ When deploying LobeChat, you need to configure the following environment variabl
72
72
  | Environment Variable | Type | Description |
73
73
  | --- | --- | --- |
74
74
  | `NEXT_AUTH_SECRET` | Required | Key used to encrypt Auth.js session tokens. You can generate the key using the following command: `openssl rand -base64 32` |
75
- | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `azure-ad` for Microsoft Entra ID. |
76
- | `AUTH_AZURE_AD_ID` | Required | Client ID of the Microsoft Entra ID application. |
77
- | `AUTH_AZURE_AD_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
78
- | `AUTH_AZURE_AD_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
75
+ | `NEXT_AUTH_SSO_PROVIDERS` | Required | Select the single sign-on provider for LoboChat. Use `microsoft-entra-id` for Microsoft Entra ID. |
76
+ | `AUTH_MICROSOFT_ENTRA_ID_ID` | Required | Client ID of the Microsoft Entra ID application. |
77
+ | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | Required | Client Secret of the Microsoft Entra ID application. |
78
+ | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | Required | Tenant ID of the Microsoft Entra ID application. |
79
79
  | `NEXTAUTH_URL` | Required | This URL is used to specify the callback address for Auth.js when performing OAuth authentication. It is only necessary to set it when the default generated redirect address is incorrect. `https://example.com/api/auth` |
80
80
 
81
81
  <Callout type={'tip'}>
@@ -24,7 +24,7 @@ tags:
24
24
  在 `Redirect URI (optional)` 中,应用类型选择 `Web`,Callback URL, 处填写:
25
25
 
26
26
  ```bash
27
- https://your-domain/api/auth/callback/azure-ad
27
+ https://your-domain/api/auth/callback/microsoft-entra-id
28
28
  ```
29
29
 
30
30
  <Callout type={'info'}>
@@ -69,10 +69,10 @@ https://your-domain/api/auth/callback/azure-ad
69
69
  | 环境变量 | 类型 | 描述 |
70
70
  | --- | --- | --- |
71
71
  | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
72
- | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `azure-ad`。 |
73
- | `AUTH_AZURE_AD_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
74
- | `AUTH_AZURE_AD_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
75
- | `AUTH_AZURE_AD_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
72
+ | `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Microsoft Entra ID 请填写 `microsoft-entra-id`。 |
73
+ | `AUTH_MICROSOFT_ENTRA_ID_ID` | 必选 | Microsoft Entra ID 应用程序的 Client ID |
74
+ | `AUTH_MICROSOFT_ENTRA_ID_SECRET` | 必选 | Microsoft Entra ID 应用程序的 Client Secret |
75
+ | `AUTH_MICROSOFT_ENTRA_ID_TENANT_ID` | 必选 | Microsoft Entra ID 应用程序的 Tenant ID |
76
76
  | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
77
77
 
78
78
  <Callout type={'tip'}>
@@ -31,7 +31,7 @@ Before using NextAuth, please set the following variables in LobeChat's environm
31
31
  | --- | --- | --- |
32
32
  | `NEXT_AUTH_SECRET` | Required | The key used to encrypt Auth.js session tokens. You can use the following command: `openssl rand -base64 32`, or visit `https://generate-secret.vercel.app/32` to generate the key. |
33
33
  | `NEXTAUTH_URL` | Required | This URL specifies the callback address for Auth.js when performing OAuth verification. Set this only if the default generated redirect address is incorrect. `https://example.com/api/auth` |
34
- | `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,azure-ad,authentik`. |
34
+ | `NEXT_AUTH_SSO_PROVIDERS` | Optional | This environment variable is used to enable multiple identity verification sources simultaneously, separated by commas, for example, `auth0,microsoft-entra-id,authentik`. |
35
35
 
36
36
  Currently supported identity verification services include:
37
37
 
@@ -56,7 +56,7 @@ Click on the links to view the corresponding platform's configuration documentat
56
56
 
57
57
  ## Advanced Configuration
58
58
 
59
- 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`.
59
+ To simultaneously enable multiple identity verification sources, please set the `NEXT_AUTH_SSO_PROVIDERS` environment variable, separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.
60
60
 
61
61
  The order corresponds to the display order of the SSO providers.
62
62
 
@@ -69,7 +69,7 @@ The order corresponds to the display order of the SSO providers.
69
69
  | Cloudflare Zero Trust | `cloudflare-zero-trust` |
70
70
  | Github | `github` |
71
71
  | Logto | `logto` |
72
- | Microsoft Entra ID | `azure-ad` |
72
+ | Microsoft Entra ID | `microsoft-entra-id` |
73
73
  | ZITADEL | `zitadel` |
74
74
 
75
75
  ## Other SSO Providers
@@ -28,7 +28,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
28
28
  | --- | --- | --- |
29
29
  | `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令: `openssl rand -base64 32`,或者访问 `https://generate-secret.vercel.app/32` 生成秘钥。 |
30
30
  | `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://example.com/api/auth` |
31
- | `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。 |
31
+ | `NEXT_AUTH_SSO_PROVIDERS` | 可选 | 该环境变量用于同时启用多个身份验证源,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。 |
32
32
 
33
33
  目前支持的身份验证服务有:
34
34
 
@@ -53,7 +53,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
53
53
 
54
54
  ## 进阶配置
55
55
 
56
- 同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,azure-ad,authentik`。
56
+ 同时启用多个身份验证源请设置 `NEXT_AUTH_SSO_PROVIDERS` 环境变量,以逗号 `,` 分割,例如 `auth0,microsoft-entra-id,authentik`。
57
57
 
58
58
  顺序为 SSO 提供商的显示顺序。
59
59
 
@@ -66,7 +66,7 @@ LobeChat 与 Clerk 做了深度集成,能够为用户提供一个更加安全
66
66
  | Cloudflare Zero Trust | `cloudflare-zero-trust` |
67
67
  | Github | `github` |
68
68
  | Logto | `logto` |
69
- | Microsoft Entra ID | `azure-ad` |
69
+ | Microsoft Entra ID | `microsoft-entra-id` |
70
70
  | ZITADEL | `zitadel` |
71
71
 
72
72
  ## 其他 SSO 提供商
@@ -29,9 +29,9 @@ LobeChat provides a complete authentication service capability when deployed. Th
29
29
  #### `NEXT_AUTH_SSO_PROVIDERS`
30
30
 
31
31
  - Type: Optional
32
- - Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,azure-ad,authentik`.
32
+ - Description: Select the single sign-on provider for LoboChat. For multiple SSO Providers separating them with commas, for example, `auth0,microsoft-entra-id,authentik`.
33
33
  - Default: `auth0`
34
- - Example: `auth0,azure-ad,authentik`
34
+ - Example: `auth0,microsoft-entra-id,authentik`
35
35
 
36
36
  #### `NEXTAUTH_URL`
37
37
 
@@ -27,9 +27,9 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
27
27
  #### `NEXT_AUTH_SSO_PROVIDERS`
28
28
 
29
29
  - 类型:可选
30
- - 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,azure-ad,authentik`
30
+ - 描述:选择 LoboChat 的单点登录提供商。如果有多个单点登录提供商,请用逗号分隔,例如 `auth0,microsoft-entra-id,authentik`
31
31
  - 默认值: `auth0`
32
- - 示例: `auth0,azure-ad,authentik`
32
+ - 示例: `auth0,microsoft-entra-id,authentik`
33
33
 
34
34
  #### `NEXTAUTH_URL`
35
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.22.10",
3
+ "version": "1.22.11",
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",
@@ -7,6 +7,7 @@ import CloudflareZeroTrust from './cloudflare-zero-trust';
7
7
  import GenericOIDC from './generic-oidc';
8
8
  import Github from './github';
9
9
  import Logto from './logto';
10
+ import MicrosoftEntraID from './microsoft-entra-id';
10
11
  import Zitadel from './zitadel';
11
12
 
12
13
  export const ssoProviders = [
@@ -20,4 +21,5 @@ export const ssoProviders = [
20
21
  Logto,
21
22
  CloudflareZeroTrust,
22
23
  Casdoor,
24
+ MicrosoftEntraID,
23
25
  ];
@@ -0,0 +1,15 @@
1
+ import MicrosoftEntraID from 'next-auth/providers/microsoft-entra-id';
2
+
3
+ import { CommonProviderConfig } from './sso.config';
4
+
5
+ const provider = {
6
+ id: 'microsoft-entra-id',
7
+ provider: MicrosoftEntraID({
8
+ ...CommonProviderConfig,
9
+ // Specify auth scope, at least include 'openid email'
10
+ // all scopes in Azure AD ref: https://learn.microsoft.com/en-us/entra/identity-platform/scopes-oidc#openid-connect-scopes
11
+ authorization: { params: { scope: 'openid email profile' } },
12
+ }),
13
+ };
14
+
15
+ export default provider;