Repository navigation
feat: XOAUTH2 hooks for OIDC authentication - #65
Open
jcdelepine wants to merge 1 commit into
Open
jcdelepine wants to merge 1 commit into
jcdelepine wants to merge 1 commit into
Conversation
Add IMP_Application::authValidate(), wired via the 'validate' auth capability, so token revocation (e.g. backchannel logout) is detected on the next request. Reads the currently-active IMP_Imap connection's server_key rather than the preferred/default backend, so validation targets the backend the user is actually connected to. Extend IMP_Imap_Config to recognise the 'oauth' backend option in backends.php. IMP_Auth::_canAutoLogin() now reads it directly to build XOAUTH2 credentials at primo-connection, regardless of the Horde auth driver — this supersedes the imap_preauthenticate hook example (removed from hooks.php.dist), which only ever fired at that same primo-connection point.
jcdelepine
force-pushed
the
feat/OidcIntegration
branch
from
September 20, 2026 15:45
d21498f to
fcf9623
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds OIDC/XOAUTH2 hook examples to hooks.php.dist:
imap_preauthenticate: injects a Horde_Imap_Client_Password_Xoauth2 object when the user has OAuth2 tokens stored, falling back to password auth otherwise.
dynamic_prefs: proactively refreshes OAuth2 tokens before they expire during a session, and updates the IMAP password stored in the Horde session so active connections use the new token.
Also relaxes the credential check in IMP_Auth to accept either a password or a xoauth2_token, allowing OIDC sessions to authenticate without a stored password.
All hook code is commented out in the .dist file and must be explicitly activated by the administrator.
Depends on: