Skip to content

Add configurable multi-auth support for local and OIDC logins#6068

Open
holger-dev wants to merge 8 commits intoBookStackApp:developmentfrom
holger-dev:development
Open

Add configurable multi-auth support for local and OIDC logins#6068
holger-dev wants to merge 8 commits intoBookStackApp:developmentfrom
holger-dev:development

Conversation

@holger-dev
Copy link

This PR extends BookStack authentication so multiple login methods can be enabled at the same time, instead of forcing a single global auth method.

The main use case is running OIDC alongside local BookStack accounts. With this change, admins can keep OIDC as the primary login method while still creating internal users with local passwords who can sign in through the normal login form.

Key changes:

  • Adds support for AUTH_METHODS as a list of enabled auth methods
  • Adds AUTH_PRIMARY_METHOD for preferred UI/redirect behavior
  • Keeps backward compatibility with existing single-method setups via AUTH_METHOD
  • Updates login/logout flow to track the actual auth method used for the session
  • Allows standard/local login to coexist with OIDC, LDAP, or SAML
  • Keeps registration, password reset, and password change available whenever standard auth is enabled
  • Updates admin user handling so local users can be created without requiring an external_auth_id when standard auth is active
  • Hardens install/deploy behavior by clearing stale Laravel package/service cache files before Composer install, avoiding issues with removed dev providers such as Clockwork

Example configuration:
AUTH_METHOD=standard
AUTH_METHODS=standard,oidc
AUTH_PRIMARY_METHOD=oidc
AUTH_AUTO_INITIATE=false

This allows:

  • OIDC login for externally managed users
  • local BookStack users with password-based login
  • admin-managed fallback/internal accounts without external identity mapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant