-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
♻️ refactor: refactor azure ad to ms entra id #4168
Conversation
@EINDEX is attempting to deploy a commit to the LobeChat Community Team on Vercel. A member of the Team first needs to authorize it. |
👍 @EINDEX Thank you for raising your pull request and contributing to our Community |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4168 +/- ##
========================================
Coverage 92.24% 92.24%
========================================
Files 493 493
Lines 35533 35533
Branches 2155 2305 +150
========================================
Hits 32777 32777
Misses 2756 2756
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
只需要改文档就好了么?不需要改实现? |
Is it just a matter of changing the document? No need to change the implementation? |
@arvinxx Sorry, that time is not ready for review. I added a new SSO module for For the documentation side, there is no setting up process from Azure AD to Entra ID. Only the env vars and redirect URL path are updated by the Next Auth package. PS: My mbp m1 pro with 16G RAM is very slow to build this project 😭. |
@arvinxx please review this PR |
抱歉 我还没改 换了个电脑 环境崩了Sent from my iPhoneOn Oct 19, 2024, at 10:45, Arvin Xu ***@***.***> wrote:
@arvinxx commented on this pull request.
In src/config/auth.ts:
@@ -265,6 +270,13 @@ export const getAuthConfig = () => {
// Casdoor
CASDOOR_WEBHOOK_SECRET: process.env.CASDOOR_WEBHOOK_SECRET,
+
+ // Microsoft Entra ID
+ MICROSOFT_ENTRA_ID_ID: process.env.MICROSOFT_ENTRA_ID_ID || process.env.AZURE_AD_CLIENT_ID,
为啥还需要加 MICROSOFT_ENTRA_ID_ID ? 这三个变量应该不需要了吧?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
@arvinxx please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, Thanks for your contribution!
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❤️ Great PR @EINDEX ❤️ The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world. |
### [Version 1.22.11](v1.22.10...v1.22.11) <sup>Released on **2024-10-20**</sup> #### ♻ Code Refactoring - **misc**: Refactor azure ad to ms entra id. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Refactor azure ad to ms entra id, closes [#4168](#4168) ([4fa9588](4fa9588)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 1.22.11 🎉 The release is available on: Your semantic-release bot 📦🚀 |
把环境变量改了是不是应该发个公告啊。。。 |
Should an announcement be made after changing the environment variables? . . |
### [Version 1.65.6](v1.65.5...v1.65.6) <sup>Released on **2024-10-20**</sup> #### ♻ Code Refactoring - **misc**: Refactor azure ad to ms entra id. #### 💄 Styles - **misc**: Add Llama 3.1 Nemotron 70B model & reorder some provider model list, add Ministral model, update Together AI model list, add function call & vision, update wenxin 4.0 turbo model to latest. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Code refactoring * **misc**: Refactor azure ad to ms entra id, closes [lobehub#4168](https://github.com/bentwnghk/lobe-chat/issues/4168) ([4fa9588](4fa9588)) #### Styles * **misc**: Add Llama 3.1 Nemotron 70B model & reorder some provider model list, closes [lobehub#4424](https://github.com/bentwnghk/lobe-chat/issues/4424) ([9355a3d](9355a3d)) * **misc**: Add Ministral model, closes [lobehub#4427](https://github.com/bentwnghk/lobe-chat/issues/4427) ([2042df8](2042df8)) * **misc**: Update Together AI model list, add function call & vision, closes [lobehub#4393](https://github.com/bentwnghk/lobe-chat/issues/4393) ([d7fbf1b](d7fbf1b)) * **misc**: Update wenxin 4.0 turbo model to latest, closes [lobehub#4428](https://github.com/bentwnghk/lobe-chat/issues/4428) ([3389fbb](3389fbb)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
Both Azure AD and Microsoft Entra ID are currently not working. Azure AD:
Microsoft Entra ID:
|
@BrandonStudio 这个是新增的,没有改旧的吧 |
@BrandonStudio This is a new addition, not an old one, right? |
@cy948 Don't MS entra id follow next auth env inference? |
@arvinxx |
@arvinxx |
参考这个 PR ,理论上应该不需要配置 process.env 的 |
Refer to this [PR](https://github.com/lobehub/lobe-chat/pull/3701#:~:text=%E5%BE%80%E5%90%8E%E6%8E%A5%E5% 85%A5%20sso%20provider%20%E6%97%B6%E4%B8%8D%E9%9C%80%E8%A6%81%E4%BB%8E%20authEnv%20%E4%B8%AD% E8%AF%BB%E5%8F%96%E5%8F%98%E9%87%8F%EF%BC%8C%E5%BD%93%E9%85%8D%E7%BD%AE%E4% B8%AD%E4%B8%8D%E5%90%ABclientId%2C%20issuer%E6%97%B6next%2Dauth%E6%89%8D%E4%BC%9A%E8%BF%9B%E8%A1% 8Cenv%20infer%EF%BC%8C%E7%A4%BA%E4%BE%8B%EF%BC%9A), theoretically there should be no need to configure process.env |
另外,ENV 使用 AUTH_MICROSOFT_ENTRA_ID_ID 和 AUTH_MICROSOFT_ENTRA_ID_SECRET 命名有點特別。 |
Also, the ENV naming is a bit special using AUTH_MICROSOFT_ENTRA_ID_ID and AUTH_MICROSOFT_ENTRA_ID_SECRET. |
@BrandonStudio when you fixed this #4723 pls RP included with this updated pics and text in https://github.com/lobehub/lobe-chat/blob/main/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx and /microsoft-entra-id.zh-CN.mdx with this parts:
You need make sure the URL enter matches ends "/api/auth/callback/microsoft-entra-id" or you can modify the Redirect URIs by On the app registration page, select Authentication. In the Platform configurations section, select Add URI to add the redirect URI displayed below 请务必保证填写的 URL 后缀是 “/api/auth/callback/microsoft-entra-id” 或者你可以后续在 “App registration -> Authentication ” 路径如下图修改重定向 URL |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
Update document for Entra ID.
📝 补充信息 | Additional Information