Skip to content

fix(auth): IMP server selector missing on login page unless auth driver is 'application'#136

Open
jcdelepine wants to merge 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:fix/imp-server-selector-login
Open

fix(auth): IMP server selector missing on login page unless auth driver is 'application'#136
jcdelepine wants to merge 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:fix/imp-server-selector-login

Conversation

@jcdelepine

Copy link
Copy Markdown
Contributor

Bug

When multiple IMAP backends are configured in backends.php with $conf['server']['server_list'] = 'shown' (imp), the server selector dropdown never appears on the login page — unless the Horde auth driver is specifically application pointed at imp.

Root cause

LoginService::buildLoginFormData() (and login.php's equivalent inline code) resolves extra login form fields via $auth->getLoginParams(), using the auth driver instance for the 'horde' app only. IMP_Application::authLoginParams() — which builds the server selector — is only reachable through this path when $conf['auth']['driver'] = 'application' with params.app = 'imp', since in that configuration 'horde' auth delegates directly to 'imp'.

With any other driver (LDAP, SQL, etc.), IMP's login params are never consulted at all, silently dropping the server selector.

Fix

Add a 'loginparams' auth capability, declared by IMP_Application::$auth (mirroring the existing 'add', 'transparent', etc. capabilities). LoginService/login.php now additionally resolve IMP's login params via this capability, independently of which driver authenticates the user to Horde itself.

Depends on the companion change in horde/imp declaring the 'loginparams' capability.

Testing

Verified the server selector now appears on both /login.php and the responsive /auth/login route with auth.driver = ldap and multiple non-disabled backends in backends.php.

LoginService::buildLoginFormData() and login.php's equivalent inline
code only resolved extra login form fields (e.g. IMP's server
selector) through the primary Horde auth driver instance. With
auth.driver = 'application' pointed at imp, this worked because
'horde' auth delegates directly to 'imp'. With any other driver
(LDAP, SQL, etc.), IMP's authLoginParams() was never consulted,
silently dropping the server selector even when
$conf['server']['server_list'] = 'shown'.

Both login.php and LoginService now additionally resolve IMP's login
params via the new 'loginparams' auth capability (see horde/imp),
independently of which driver authenticates the user to Horde itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant