Skip to content

feat: OIDC/OAuth2 authentication driver and SLO support#160

Open
jcdelepine wants to merge 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:feat/OidcIntegration
Open

feat: OIDC/OAuth2 authentication driver and SLO support#160
jcdelepine wants to merge 1 commit into
horde:FRAMEWORK_6_0from
jcdelepine:feat/OidcIntegration

Conversation

@jcdelepine

Copy link
Copy Markdown
Contributor

Adds a complete OIDC/OAuth2 authentication integration for Horde:

  • Horde_Core_Auth_Oidc: auth driver that validates sessions by checking that OAuth2 tokens are still present in the repository. Authentication itself is handled by OAuthAccountController via the /auth/oauth/login flow. User listing via LDAP.

  • PreLogoutHandlerInterface: contract for pre-logout hooks called by LoginService::performLogout() before clearAuth(). Handlers may revoke tokens, trigger SLO, or return a post-logout redirect URL.

  • OidcPreLogoutHandler: implementation supporting three logout strategies:

    • local: remove tokens from local storage only
    • slo: remove tokens + redirect to IdP end_session_endpoint
    • revoke_and_slo: revoke tokens at provider + SLO redirect
  • OidcBackchannelLogoutController: endpoint for RFC 9470 back-channel logout. Validates signed logout_token JWTs (RS256/ES256 via JWKS), enforces jti replay protection, and removes the affected user's tokens.

  • OidcHookHelper: static helpers centralising token refresh logic for IMAP/SMTP/Sieve XOAUTH2 hooks.

  • OAuthTokenRepositoryFactory: SQL-backed token repository wired through the DI container, configurable via the admin UI.

  • Unit tests for OidcPreLogoutHandler and OidcHookHelper.

  • OIDC.md: installation and configuration guide.

Depends on:

  • horde/Jwt: Jwk::toPublicKey() (merged)
  • horde/Oauth: OAuth2Client::revokeToken() (merged)

Adds a complete OIDC/OAuth2 authentication integration for Horde:

- Horde_Core_Auth_Oidc: auth driver that validates sessions by checking
  that OAuth2 tokens are still present in the repository. Authentication
  itself is handled by OAuthAccountController via the /auth/oauth/login
  flow. User listing via LDAP.

- PreLogoutHandlerInterface: contract for pre-logout hooks called by
  LoginService::performLogout() before clearAuth(). Handlers may revoke
  tokens, trigger SLO, or return a post-logout redirect URL.

- OidcPreLogoutHandler: implementation supporting three logout strategies:
    - local: remove tokens from local storage only
    - slo: remove tokens + redirect to IdP end_session_endpoint
    - revoke_and_slo: revoke tokens at provider + SLO redirect

- OidcBackchannelLogoutController: endpoint for RFC 9470 back-channel
  logout. Validates signed logout_token JWTs (RS256/ES256 via JWKS),
  enforces jti replay protection, and removes the affected user's tokens.

- OidcHookHelper: static helpers centralising token refresh logic for
  IMAP/SMTP/Sieve XOAUTH2 hooks.

- OAuthTokenRepositoryFactory: SQL-backed token repository wired through
  the DI container, configurable via the admin UI.

- Unit tests for OidcPreLogoutHandler and OidcHookHelper.

- OIDC.md: installation and configuration guide.

Depends on:
- horde/Jwt: Jwk::toPublicKey() (merged)
- horde/Oauth: OAuth2Client::revokeToken() (merged)
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