Skip to content
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

๐Ÿ› fix: Fix MS Entra ID and Azure AD authorization #4579

Merged
merged 4 commits into from
Nov 3, 2024

Conversation

BrandonStudio
Copy link
Contributor

@BrandonStudio BrandonStudio commented Nov 2, 2024

๐Ÿ’ป ๅ˜ๆ›ด็ฑปๅž‹ | Change Type

  • โœจ feat
  • ๐Ÿ› fix
  • โ™ป๏ธ refactor
  • ๐Ÿ’„ style
  • ๐Ÿ‘ท build
  • โšก๏ธ perf
  • ๐Ÿ“ docs
  • ๐Ÿ”จ chore

๐Ÿ”€ ๅ˜ๆ›ด่ฏดๆ˜Ž | Description of Change

Fix MS Entra ID and Azure AD authorization

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

refs:

ๆˆ‘TM็œŸๆœไบ†๏ผŒๆ–‡ๆกฃ้‡Œๅ•ฅไนŸไธ่ฏดๅฐฑ็ป™ไธชISSUER๏ผŒ่ฐTM็Ÿฅ้“ISSUERๆ˜ฏไป€ไนˆไธœ่ฅฟ

่ฟ˜ๆœ‰่ฟ™ไธชไธœ่ฅฟไนŸ็œŸๆ˜ฏ็ฅžไบบไบ†๏ผšhttps://github.com/lobehub/lobe-chat/pull/4438/files#diff-c7ca9233b0e6ca50520af2931b10c2d06f70efbf56ab9289e62ba44c92243024R17-R18
ไบบๅฎถๅ‡ฝๆ•ฐ้ƒฝๆฒก่ฟ™้กน๏ผŒไฝ ไผ ่ฟ›ๅŽป่ƒฝๆœ‰ๅ•ฅ็”จ

Add client ID, client secret, and issuer for the Microsoft Entra ID SSO provider in the next-auth library.
Copy link

vercel bot commented Nov 2, 2024

@BrandonStudio is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. azure ๐Ÿ› Bug Something isn't working | ็ผบ้™ท labels Nov 2, 2024
@lobehubbot
Copy link
Member

๐Ÿ‘ @BrandonStudio

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆๅ‡บๆ‹‰ๅ–่ฏทๆฑ‚ๅนถไธบๆˆ‘ไปฌ็š„็คพๅŒบๅšๅ‡บ่ดก็Œฎ๏ผŒ่ฏท็กฎไฟๆ‚จๅทฒ็ป้ตๅพชไบ†ๆˆ‘ไปฌ็š„่ดก็ŒฎๆŒ‡ๅ—๏ผŒๆˆ‘ไปฌไผšๅฐฝๅฟซๅฎกๆŸฅๅฎƒใ€‚
ๅฆ‚ๆžœๆ‚จ้‡ๅˆฐไปปไฝ•้—ฎ้ข˜๏ผŒ่ฏท้šๆ—ถไธŽๆˆ‘ไปฌ่”็ณปใ€‚

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests โœ…

Project coverage is 92.69%. Comparing base (63ba4d3) to head (94d6444).
Report is 74 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4579      +/-   ##
==========================================
+ Coverage   92.26%   92.69%   +0.42%     
==========================================
  Files         493      507      +14     
  Lines       35748    36450     +702     
  Branches     2169     2221      +52     
==========================================
+ Hits        32982    33786     +804     
+ Misses       2766     2664     -102     
Flag Coverage ฮ”
app 92.69% <รธ> (+0.42%) โฌ†๏ธ
server 97.34% <รธ> (+<0.01%) โฌ†๏ธ

Flags with carried forward coverage won't be shown. Click here to find out more.

โ˜” View full report in Codecov by Sentry.
๐Ÿ“ข Have feedback on the report? Share it here.

Copy link

vercel bot commented Nov 3, 2024

The latest updates on your projects. Learn more about Vercel for Git โ†—๏ธŽ

Name Status Preview Comments Updated (UTC)
lobe-chat-database โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Nov 3, 2024 10:15am
lobe-chat-preview โœ… Ready (Inspect) Visit Preview ๐Ÿ’ฌ Add feedback Nov 3, 2024 10:15am

@arvinxx arvinxx changed the title Fix MS Entra ID and Azure AD authorization ๐Ÿ› fix: Fix MS Entra ID and Azure AD authorization Nov 3, 2024
@arvinxx
Copy link
Contributor

arvinxx commented Nov 3, 2024

ๅŽ้ข Azure AD ๆ˜ฏไธๆ˜ฏๅฐฑๆฒกไบ†๏ผŸ

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Will Azure AD disappear later?

@arvinxx
Copy link
Contributor

arvinxx commented Nov 3, 2024

่ฟ˜ๆœ‰่ฟ™ไธชไธœ่ฅฟไนŸ็œŸๆ˜ฏ็ฅžไบบไบ†๏ผšhttps://github.com/lobehub/lobe-chat/pull/4438/files#diff-c7ca9233b0e6ca50520af2931b10c2d06f70efbf56ab9289e62ba44c92243024R17-R18
ไบบๅฎถๅ‡ฝๆ•ฐ้ƒฝๆฒก่ฟ™้กน๏ผŒไฝ ไผ ่ฟ›ๅŽป่ƒฝๆœ‰ๅ•ฅ็”จ

ๆ–‡ๆกฃ้‡Œๆœ‰็š„ๅ•Š๏ผŸ https://authjs.dev/getting-started/providers/azure-ad ่™ฝ็„ถๆˆ‘ไธๆธ…ๆฅšไธบๅ•ฅnext-auth ็‰ˆๆœฌๅ‡็บงไปฅๅŽ่ฟ™ไธช็ฑปๅž‹ๅฐฑๆฒกไบ†

image

@BrandonStudio
Copy link
Contributor Author

ๆ‰€ไปฅ้ช‚ไป–ไปฌauthjs๏ผŒ

  1. AzureADๅ˜ๆˆEntraID๏ผŒไธไฟ็•™ๅŽŸๆฅ็š„API๏ผŒ็›ดๆŽฅๆŠŠAzureADๅ˜ๆˆEntraID็š„ๅˆซๅ
  2. ไธญๆ–ญๆ€งๅ˜ๆ›ดๆ–‡ๆกฃ้‡ŒๅฎŒๅ…จๆฒกๆœ‰ไฝ“็Žฐ
  3. ๆ–ฐ EntraID ๆ–‡ๆกฃไธ็Ÿฅ้“ๅœจ่ฏดไป€ไนˆ

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


So scold them authjs,

  1. AzureAD becomes EntraID, without retaining the original API, directly turning AzureAD into an alias of EntraID
  2. Disruptive changes are not reflected at all in the document
  3. The new EntraID document has no idea what itโ€™s talking about.

@BrandonStudio
Copy link
Contributor Author

ๅŽ้ข Azure AD ๆ˜ฏไธๆ˜ฏๅฐฑๆฒกไบ†๏ผŸ

ๅฏน็š„๏ผŒ่€ƒ่™‘่ฎกๅˆ’ๅผƒ็”จ๏ผŒๆฏ”ๅฆ‚ๆŸไธชๆ—ถ้—ด่Š‚็‚นๆˆ–่€…ๆŸไธช็‰ˆๆœฌ็ปŸไธ€ๅผƒ็”จ

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


Will Azure AD disappear later?

Yes, consider planning for deprecation, such as deprecating it uniformly at a certain time point or a certain version.

@arvinxx
Copy link
Contributor

arvinxx commented Nov 3, 2024

ๅฏน็š„๏ผŒ่€ƒ่™‘่ฎกๅˆ’ๅผƒ็”จ๏ผŒๆฏ”ๅฆ‚ๆŸไธชๆ—ถ้—ด่Š‚็‚นๆˆ–่€…ๆŸไธช็‰ˆๆœฌ็ปŸไธ€ๅผƒ็”จ

LobeChat 2.0 ็งป้™คๅงใ€‚ๆˆ‘ๅŠ ไธ€ไธ‹่ฟ™ไธชไบ‹้กนๅˆฐ่ฟ™้‡Œ: #3283

@arvinxx arvinxx merged commit ced8a08 into lobehub:main Nov 3, 2024
8 checks passed
@lobehubbot
Copy link
Member

โค๏ธ Great PR @BrandonStudio โค๏ธ

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.
้กน็›ฎ็š„ๆˆ้•ฟ็ฆปไธๅผ€็”จๆˆทๅ้ฆˆๅ’Œ่ดก็Œฎ๏ผŒๆ„Ÿ่ฐขๆ‚จ็š„่ดก็Œฎ! ๅฆ‚ๆžœๆ‚จๅฏน LobeHub ๅผ€ๅ‘่€…็คพๅŒบๆ„Ÿๅ…ด่ถฃ๏ผŒ่ฏทๅŠ ๅ…ฅๆˆ‘ไปฌ็š„ discord๏ผŒ็„ถๅŽ็งไฟก @arvinxx ๆˆ– @canisminor1990ใ€‚ไป–ไปฌไผš้‚€่ฏทๆ‚จๅŠ ๅ…ฅๆˆ‘ไปฌ็š„็งๅฏ†ๅผ€ๅ‘่€…้ข‘้“ใ€‚ๆˆ‘ไปฌๅฐ†ไผš่ฎจ่ฎบๅ…ณไบŽ Lobe Chat ็š„ๅผ€ๅ‘๏ผŒๅˆ†ไบซๅ’Œ่ฎจ่ฎบๅ…จ็ƒ่Œƒๅ›ดๅ†…็š„ AI ๆถˆๆฏใ€‚

github-actions bot pushed a commit that referenced this pull request Nov 3, 2024
### [Version&nbsp;1.26.18](v1.26.17...v1.26.18)
<sup>Released on **2024-11-03**</sup>

#### ๐Ÿ› Bug Fixes

- **misc**: Fix MS Entra ID and Azure AD authorization.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix MS Entra ID and Azure AD authorization, closes [#4579](#4579) ([ced8a08](ced8a08))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

๐ŸŽ‰ This PR is included in version 1.26.18 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Nov 3, 2024
### [Version&nbsp;1.69.10](v1.69.9...v1.69.10)
<sup>Released on **2024-11-03**</sup>

#### ๐Ÿ› Bug Fixes

- **misc**: Fix duplicate key value violates unique constraint "slug_user_id_unique" when create inbox session, Fix MS Entra ID and Azure AD authorization.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Fix duplicate key value violates unique constraint "slug_user_id_unique" when create inbox session, closes [lobehub#4596](https://github.com/bentwnghk/lobe-chat/issues/4596) ([c5af96e](c5af96e))
* **misc**: Fix MS Entra ID and Azure AD authorization, closes [lobehub#4579](https://github.com/bentwnghk/lobe-chat/issues/4579) ([ced8a08](ced8a08))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@BrandonStudio BrandonStudio deleted the ms-entra-id branch November 4, 2024 08:21
@BrandonStudio
Copy link
Contributor Author

่ฟ™ไธชEntra ID่ฟ˜ๅทฎไธ€ไธชprofile

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


This Entra ID still needs a profile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
azure ๐Ÿ› Bug Something isn't working | ็ผบ้™ท released size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants