[PR #1866] [MERGED] Auth service alignment #5912

Closed
opened 2026-02-05 10:20:14 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/BookStackApp/BookStack/pull/1866
Author: @ssddanbrown
Created: 2/1/2020
Status: Merged
Merged: 2/2/2020
Merged by: @ssddanbrown

Base: masterHead: auth_alignment


📝 Commits (9)

  • 575b850 Started alignment of auth services
  • 7728931 Set more appropriate login validation and broken up LDAP guide a bit
  • 3470a6a Aligned SAML2 system with LDAP implementation in terms of guards and UI
  • e743cd3 Added files missed in previous commit
  • 5d08ec3 Fixed failing tests caused by auth changes
  • e6c6de0 Simplified guard names and rolled out guard route checks
  • 3991fbe Checked over and aligned registration option behavior across all auth options
  • b4f2b73 Updated settings-save action to return to the same section
  • 9d77cca Cleaned setting section redirect path

📊 Changes

47 files changed (+1088 additions, -499 deletions)

View changed files

📝 .env.example.complete (+1 -3)
📝 app/Auth/Access/ExternalAuthService.php (+2 -4)
📝 app/Auth/Access/ExternalBaseUserProvider.php (+9 -42)
app/Auth/Access/Guards/ExternalBaseSessionGuard.php (+305 -0)
app/Auth/Access/Guards/LdapSessionGuard.php (+114 -0)
app/Auth/Access/Guards/Saml2SessionGuard.php (+40 -0)
📝 app/Auth/Access/LdapService.php (+4 -13)
📝 app/Auth/Access/RegistrationService.php (+59 -14)
📝 app/Auth/Access/Saml2Service.php (+21 -38)
📝 app/Auth/Access/SocialAuthService.php (+2 -2)
📝 app/Auth/User.php (+12 -10)
📝 app/Auth/UserRepo.php (+8 -26)
📝 app/Config/auth.php (+17 -12)
📝 app/Config/saml2.php (+0 -4)
app/Exceptions/AuthException.php (+0 -6)
📝 app/Exceptions/Handler.php (+4 -1)
app/Exceptions/LoginAttemptEmailNeededException.php (+6 -0)
app/Exceptions/LoginAttemptException.php (+6 -0)
📝 app/Http/Controllers/Auth/ForgotPasswordController.php (+1 -0)
📝 app/Http/Controllers/Auth/LoginController.php (+84 -66)

...and 27 more files

📄 Description

Review of auth services and attempted alignment to reduce maintenance overhead, setting confusion and possible auth side-effects.

Found necessary after documenting SAML auth for v0.28, but finding to be un-aligned from everything else.

TODO

  • Align SAML auth to LDAP implementation.
  • Protect auth-specific routes with current active auth check.
  • Update registration settings area to clarify what and how settings are used for different auth methods.
  • Check LDAP and SAML email confirmation flow behaviour matches.
  • Cover and update testing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/BookStackApp/BookStack/pull/1866 **Author:** [@ssddanbrown](https://github.com/ssddanbrown) **Created:** 2/1/2020 **Status:** ✅ Merged **Merged:** 2/2/2020 **Merged by:** [@ssddanbrown](https://github.com/ssddanbrown) **Base:** `master` ← **Head:** `auth_alignment` --- ### 📝 Commits (9) - [`575b850`](https://github.com/BookStackApp/BookStack/commit/575b85021d4f6d9507816710a5b96f6a9742d6bf) Started alignment of auth services - [`7728931`](https://github.com/BookStackApp/BookStack/commit/7728931f150cb9f80a98cf6a2f947d7f25532cc4) Set more appropriate login validation and broken up LDAP guide a bit - [`3470a6a`](https://github.com/BookStackApp/BookStack/commit/3470a6a140e7e87cbb53332d9a8b50e5693603ef) Aligned SAML2 system with LDAP implementation in terms of guards and UI - [`e743cd3`](https://github.com/BookStackApp/BookStack/commit/e743cd3f606fb8a2e432813f7c84fed1093f68c4) Added files missed in previous commit - [`5d08ec3`](https://github.com/BookStackApp/BookStack/commit/5d08ec3cef1d9a2a1c96f47371f94f0762a49075) Fixed failing tests caused by auth changes - [`e6c6de0`](https://github.com/BookStackApp/BookStack/commit/e6c6de0848caab863f410bbf9a74312392db9dcd) Simplified guard names and rolled out guard route checks - [`3991fbe`](https://github.com/BookStackApp/BookStack/commit/3991fbe726c527b89d06cb0b2afdca705cafa494) Checked over and aligned registration option behavior across all auth options - [`b4f2b73`](https://github.com/BookStackApp/BookStack/commit/b4f2b735904169eb12a05cb0befc4ff38beaeaee) Updated settings-save action to return to the same section - [`9d77cca`](https://github.com/BookStackApp/BookStack/commit/9d77cca7340dec4872fba4742e7aa7c6d25e6052) Cleaned setting section redirect path ### 📊 Changes **47 files changed** (+1088 additions, -499 deletions) <details> <summary>View changed files</summary> 📝 `.env.example.complete` (+1 -3) 📝 `app/Auth/Access/ExternalAuthService.php` (+2 -4) 📝 `app/Auth/Access/ExternalBaseUserProvider.php` (+9 -42) ➕ `app/Auth/Access/Guards/ExternalBaseSessionGuard.php` (+305 -0) ➕ `app/Auth/Access/Guards/LdapSessionGuard.php` (+114 -0) ➕ `app/Auth/Access/Guards/Saml2SessionGuard.php` (+40 -0) 📝 `app/Auth/Access/LdapService.php` (+4 -13) 📝 `app/Auth/Access/RegistrationService.php` (+59 -14) 📝 `app/Auth/Access/Saml2Service.php` (+21 -38) 📝 `app/Auth/Access/SocialAuthService.php` (+2 -2) 📝 `app/Auth/User.php` (+12 -10) 📝 `app/Auth/UserRepo.php` (+8 -26) 📝 `app/Config/auth.php` (+17 -12) 📝 `app/Config/saml2.php` (+0 -4) ➖ `app/Exceptions/AuthException.php` (+0 -6) 📝 `app/Exceptions/Handler.php` (+4 -1) ➕ `app/Exceptions/LoginAttemptEmailNeededException.php` (+6 -0) ➕ `app/Exceptions/LoginAttemptException.php` (+6 -0) 📝 `app/Http/Controllers/Auth/ForgotPasswordController.php` (+1 -0) 📝 `app/Http/Controllers/Auth/LoginController.php` (+84 -66) _...and 27 more files_ </details> ### 📄 Description Review of auth services and attempted alignment to reduce maintenance overhead, setting confusion and possible auth side-effects. Found necessary after documenting SAML auth for v0.28, but finding to be un-aligned from everything else. ### TODO - [x] Align SAML auth to LDAP implementation. - [x] Protect auth-specific routes with current active auth check. - [x] Update registration settings area to clarify what and how settings are used for different auth methods. - [x] Check LDAP and SAML email confirmation flow behaviour matches. - [x] Cover and update testing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 10:20:14 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#5912