Skip to content

[DSIP-88][Auth] Enhancing Apache DolphinScheduler with Generalized OIDC Authentication - Integrate OIDC Flow into Login Controller#17341

Closed
tusaryan wants to merge 1 commit intoapache:devfrom
tusaryan:feature/17171-oidc-controller-integration
Closed

[DSIP-88][Auth] Enhancing Apache DolphinScheduler with Generalized OIDC Authentication - Integrate OIDC Flow into Login Controller#17341
tusaryan wants to merge 1 commit intoapache:devfrom
tusaryan:feature/17171-oidc-controller-integration

Conversation

@tusaryan
Copy link
Copy Markdown
Contributor

This pull request integrates the OIDC authentication flow into the LoginController, exposing the feature via REST endpoints. It introduces the necessary endpoints to initiate the OIDC login redirect and handle the callback from the identity provider.

Upon successful authentication via the OidcAuthenticator, this PR ensures a user session is created using the existing SessionService, fully enabling OIDC as a valid login method.

Closes: #17171 (Part 2)

Purpose of the pull request

Brief change log

  • Feature: Added the /oauth2/authorization/{providerId} endpoint in LoginController to initiate the OIDC login flow and redirect users to the Identity Provider.
  • Feature: Added the /login/oauth2/code/{providerId} endpoint in LoginController to handle the callback from the OIDC provider, process the authorization code, and create a user session.
  • Feature: Added the /oidc-providers endpoint to LoginController to expose the list of configured providers to the UI.
  • Enhancement: Updated AppConfiguration.java to exclude the new OIDC endpoints from the LoginHandlerInterceptor, allowing unauthenticated access for the login process.
  • Test: Added LoginControllerOidcTest.java to provide comprehensive unit tests for the new OIDC endpoints, mocking the OidcAuthenticator and SessionService to verify redirect logic, error handling, and successful session creation.
  • Test: Updated LoginControllerTest.java to ensure existing password-based login functionality remains unaffected.

Verify this pull request

This change is covered by new and updated unit tests:

  • LoginControllerOidcTest.java: Mocks the entire OIDC login flow to test the controller logic, including successful login, error callbacks from the IdP, and internal authentication failures.
  • LoginControllerTest.java: Ensures no regressions in existing login functionalities.

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

Introduces OIDC authentication endpoints and logic to LoginController, including provider listing, OIDC login redirection, and callback handling. Updates AppConfiguration to allow new OIDC-related paths. Adds comprehensive unit tests for OIDC authentication scenarios in LoginControllerOidcTest and extends LoginControllerTest with additional login validation cases.
@Gallardot
Copy link
Copy Markdown
Member

@tusaryan This PR should be merged into #17340. So I close this one. Let's discuss on #17340.

@Gallardot Gallardot closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DSIP-88][Auth] Enhancing Apache DolphinScheduler with Generalized OIDC Authentication

2 participants