Skip to content

fix(ui): hide Login Configuration when an external SSO provider is configured - #33598

Merged
sweta1308 merged 11 commits into
mainfrom
fix/hide-login-configuration-under-sso
Sep 22, 2026
Merged

sweta1308 merged 11 commits into
mainfrom
fix/hide-login-configuration-under-sso

Conversation

@sweta1308

@sweta1308 sweta1308 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #17898

Settings > Preferences > Login Configuration is only meaningful when OpenMetadata drives the login itself. The three settings there‚ max login fail attempts, access block time and JWT token expiry ‚ are enforced by the native login flow. Under an external IdP the IdP owns all three, so the values do nothing.

The page already knew this and skipped fetching the config for non-basic providers, but it still rendered, so it showed -- for every field and kept a working Edit button. Admins could save values that would never take effect.

This hides the menu entry and 404s both routes when an external SSO provider is configured. basic, ldap and openmetadata keep the page‚ the server routes openmetadata through BasicAuthServletHandler and LdapAuthenticator reads the same three settings, so the configuration is genuinely enforced for all three.

Type of change:

  • Improvement

High-level design:

Added isLoginConfigurationApplicable(provider) in AuthProvider.util.ts as the single rule, used by both surfaces so they cannot drift:

  • GlobalSettingsClassBase.ts gates the menu entry on it alongside the existing admin check. Both the Preferences tiles and the settings nav derive from this list, so one change covers both.
  • SettingsRouter.tsx redirects the details and edit routes to NOT_FOUND, matching the existing guards in that file.
  • LoginConfigurationPage.tsx drops its own provider check, which the route now makes unreachable.

The provider is passed into getGlobalSettingsMenuWithPermission as an optional argument rather than read from the application store, so the util stays free of hook dependencies.

Tests:

Use cases covered

  • Admin on basic, LDAP or openmetadata still sees Login Configuration and can open both pages
  • Admin on Google/Okta/Azure/Auth0/SAML/Custom OIDC/AWS Cognito no longer sees the entry
  • Direct or bookmarked URLs to the details and edit pages 404 under external SSO
  • Non-admins still do not see the entry under basic auth

Unit tests

  • Added unit tests.

  • src/utils/GlobalSettingsClassBase.test.ts, asserts isProtected for every provider in the enum

  • src/components/AppRouter/SettingsRouter.test.tsx‚ route guards for both routes

88 tests pass. Coverage: GlobalSettingsClassBase.ts 98.68%, SettingsRouter.tsx 81.67%, GlobalSettingCategoryPage.tsx 75.67%. GlobalSettingPage.tsx has no existing test suite and none was added — the change there is three lines passing the provider through.

Backend integration tests

  • Not applicable (no backend changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • No new spec added.

playwright/e2e/Pages/LoginConfiguration.spec.ts already reaches the page by clicking the menu item, so it runs through this gate on every PR under the @basic project. The SSO path can only run in the nightly sso-auth project against real IdP credentials, so it was verified manually instead.

Manual testing performed

Tested against the local Keycloak fixture (docker/local-sso/keycloak-saml), with the UI served from the application container.

Before, on custom-oidc: the page was reachable and showed -- for all three fields, while the stored values were 2 / 30 / 3600.

After, on the same provider as an admin:

  1. Settings > Preferences‚ no Login Configuration entry
  2. /settings/preferences/loginConfiguration‚ 404 page

Basic auth unchanged: the page still shows 2 / 30 / 3600.

UI screen recording / screenshots:

Screen-Recording.52.mp4

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For UI changes: I attached a screen recording and/or screenshots above.
  • I have added tests around the new logic.

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the earlier OpenMetadata-provider regression is fixed and no new actionable defects remain.

Summary

This PR hides Login Configuration when authentication is delegated to an external identity provider while preserving it for Basic, LDAP, and OpenMetadata authentication.

  • Centralizes provider applicability in isLoginConfigurationApplicable.
  • Applies the rule to settings menus and both direct routes.
  • Makes the page fetch configuration unconditionally after the route guard admits it.
  • Adds coverage for native providers, external providers, route access, and administrator permissions.
  • The previously reported exclusion of AuthProvider.Openmetadata is fixed.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Settings UI or direct login-configuration URL] --> B{Authentication provider}
  B -->|Basic, LDAP, OpenMetadata| C{Administrator}
  B -->|External identity provider| D[Hide menu entry]
  D --> E[Redirect direct routes to /404]
  C -->|Yes| F[Show Login Configuration]
  C -->|No| G[Deny through existing admin protection]
  F --> H[Fetch and edit enforced login settings]
Loading

Reviews (6) · Last reviewed commit: "chore(playwright): auto-refresh impact-m..."

…nfigured

The login configuration (failed-attempt lockout, access block time, JWT
expiry) is enforced by OpenMetadata's own login flow. Under an external IdP
those settings are inert, but the page was still listed under Settings >
Preferences for every admin.

LoginConfigurationPage already knew this and skipped the fetch for non-basic
providers, but still rendered — so the page showed "--" for every field, and
the Edit button stayed live, letting an admin save values that never take
effect.

Gate the menu item on the provider alongside the existing admin check, and
404 both the details and edit routes so a bookmarked URL cannot reach them,
matching the existing Navigate-to-NOT_FOUND guards in SettingsRouter. With
the route as the single gate, the page's own unreachable provider check is
removed.

LDAP is treated as basic: the server enforces the same login config for it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Sep 18, 2026
sweta1308 and others added 2 commits September 18, 2026 22:28
Review caught that the provider predicate excluded AuthProvider.Openmetadata.
That is wrong: the server routes `openmetadata` through BasicAuthServletHandler
("OpenMetadata provider uses Basic auth internally",
AuthServeletHandlerFactory), and JwtFilter#isSameProvider documents `basic` and
`openmetadata` as two historical names for the same native-password
authenticator. The login configuration is therefore enforced for it, and hiding
the page removed access to settings that were still live.

LDAP stays included — LdapAuthenticator reads the same three settings
(maxLoginFailAttempts, accessBlockTime, jwtTokenExpiryTime).

Renamed isBasicAuthProvider to isLoginConfigurationApplicable: the set is three
providers, not "basic", and the name now states the rule it encodes rather than
one of its members.

Tests assert all three providers keep the page; the hidden set stays derived
from the enum so a newly added provider defaults to hidden.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
CI failed with "useApplicationStore.getState is not a function". Reading the
store inside getGlobalSettingsMenuWithPermission made a pure util depend on a
hook, so every test that mocks useApplicationStore as a bare jest.fn() — 141
files do — crashed the moment it reached the settings menu.
EntitySearchSettings.test.tsx was the one that broke.

frontend-performance.md already forbids this ("pure utilities cannot depend on
React, UI/state layers, pages, hooks, or REST"). It was dismissed because lint
did not flag it and TableClassBase does the same thing; the rule was right and
the precedent is a latent bug of the same shape.

The provider is now an optional third argument, passed by the two pages that
actually render the entry. Omitting it leaves the entry visible: showing an
inert settings page is cosmetic, hiding a live one takes working settings away
from admins.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.44% (103500/142866) 57.54% (63003/109489) 58.59% (20626/35198)

sweta1308 and others added 3 commits September 19, 2026 16:23
Resolved .github/playwright/impact-map.generated.json by regenerating it
(python3 .github/scripts/generate_playwright_impact_map.py) on top of main's
version rather than hand-merging a generated file.

AuthProvider.util.ts auto-merged: main's AuthCoordinator/validator refactor
(#31675) and this branch's isLoginConfigurationApplicable predicate touch
different parts of the file; both verified present afterwards.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 797 → 797
- 0 added, 0 removed, 0 changed spec-list

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-21T13:01:25Z)

Blocked the queue: playwright-summary

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-09-22T04:05:05Z)

No failing check on merge-queue commit 936d546 — invalidated by an entry ahead in the queue, or a required check timed out.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 Playwright impact map auto-refreshed

This PR touched specs or UI source that changed the source→spec routing map. I regenerated .github/playwright/impact-map.generated.json and pushed the diff to this branch.

- source entries: 796 → 796
- 0 added, 0 removed, 3 changed spec-list

Entries whose spec list changed:
  openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewNew.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditorPreviewerV1.tsx
  openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/TaskDescriptionPreviewer.tsx

What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing getByTestId strings. Hand-authored routing in impact-map.json always wins on conflict.

What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit:

python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit  # or a separate commit

@gitar-bot

gitar-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Authentication-provider-dependent settings visibility and route availability change

Hides Login Configuration menu entry and routes when an external SSO provider is configured, since those settings are only enforced under basic, LDAP, or OpenMetadata authentication. Centralizes the provider applicability rule in isLoginConfigurationApplicable() and applies it consistently to settings navigation and direct route access. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 64 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 64 warning(s) across 4 changed file(s).

Count Rule
60 no-restricted-imports
3 react-hooks/exhaustive-deps
1 openmetadata-imports/no-circular-imports
All findings
Location Rule Message
🟡 src/pages/Configuration/LoginConfigurationDetails/LoginConfigurationPage.tsx:49:5 react-hooks/exhaustive-deps React Hook useMemo has a missing dependency: 't'. Either include it or remove the dependency array.
🟡 src/pages/GlobalSettingPage/GlobalSettingCategory/GlobalSettingCategoryPage.tsx:165:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/pages/GlobalSettingPage/GlobalSettingPage.tsx:79:6 react-hooks/exhaustive-deps React Hook useCallback has a missing dependency: 'navigate'. Either include it or remove the dependency array.
🟡 src/utils/GlobalSettingsClassBase.ts:13:1 no-restricted-imports '../assets/svg/admin-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abs
🟡 src/utils/GlobalSettingsClassBase.ts:14:1 no-restricted-imports '../assets/svg/api-collection-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the desig
🟡 src/utils/GlobalSettingsClassBase.ts:15:1 no-restricted-imports '../assets/svg/api-endpoints-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:16:1 no-restricted-imports '../assets/svg/apis-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abst
🟡 src/utils/GlobalSettingsClassBase.ts:17:1 no-restricted-imports '../assets/svg/app-mode.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstract
🟡 src/utils/GlobalSettingsClassBase.ts:18:1 no-restricted-imports '../assets/svg/application-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designat
🟡 src/utils/GlobalSettingsClassBase.ts:19:1 no-restricted-imports '../assets/svg/bot-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abstr
🟡 src/utils/GlobalSettingsClassBase.ts:20:1 no-restricted-imports '../assets/svg/chart-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abs
🟡 src/utils/GlobalSettingsClassBase.ts:21:1 no-restricted-imports '../assets/svg/column-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated ab
🟡 src/utils/GlobalSettingsClassBase.ts:22:1 no-restricted-imports '../assets/svg/dashboard-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:23:1 no-restricted-imports '../assets/svg/dashboard-data-models-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use th
🟡 src/utils/GlobalSettingsClassBase.ts:24:1 no-restricted-imports '../assets/svg/data-asset-rules.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/GlobalSettingsClassBase.ts:25:1 no-restricted-imports '../assets/svg/data-assets-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the desi
🟡 src/utils/GlobalSettingsClassBase.ts:26:1 no-restricted-imports '../assets/svg/data-product-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:27:1 no-restricted-imports '../assets/svg/database-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:28:1 no-restricted-imports '../assets/svg/database-schema-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the desi
🟡 src/utils/GlobalSettingsClassBase.ts:29:1 no-restricted-imports '../assets/svg/directory-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:30:1 no-restricted-imports '../assets/svg/domain-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated ab
🟡 src/utils/GlobalSettingsClassBase.ts:31:1 no-restricted-imports '../assets/svg/drive-service-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the de
🟡 src/utils/GlobalSettingsClassBase.ts:32:1 no-restricted-imports '../assets/svg/email-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abs
🟡 src/utils/GlobalSettingsClassBase.ts:33:1 no-restricted-imports '../assets/svg/file-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/GlobalSettingsClassBase.ts:34:1 no-restricted-imports '../assets/svg/glossary-term-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the de
🟡 src/utils/GlobalSettingsClassBase.ts:35:1 no-restricted-imports '../assets/svg/health-check.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abst
🟡 src/utils/GlobalSettingsClassBase.ts:36:1 no-restricted-imports '../assets/svg/learning-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/GlobalSettingsClassBase.ts:37:1 no-restricted-imports '../assets/svg/lineage-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/GlobalSettingsClassBase.ts:38:1 no-restricted-imports '../assets/svg/login-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abs
🟡 src/utils/GlobalSettingsClassBase.ts:39:1 no-restricted-imports '../assets/svg/messaging-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:40:1 no-restricted-imports '../assets/svg/metadata-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:41:1 no-restricted-imports '../assets/svg/metric-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designate
🟡 src/utils/GlobalSettingsClassBase.ts:42:1 no-restricted-imports '../assets/svg/ml-models-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:43:1 no-restricted-imports '../assets/svg/notification-alert-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use t
🟡 src/utils/GlobalSettingsClassBase.ts:44:1 no-restricted-imports '../assets/svg/persona-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/GlobalSettingsClassBase.ts:45:1 no-restricted-imports '../assets/svg/pipelines-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the design
🟡 src/utils/GlobalSettingsClassBase.ts:46:1 no-restricted-imports '../assets/svg/policies-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:47:1 no-restricted-imports '../assets/svg/preferences-omd.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated a
🟡 src/utils/GlobalSettingsClassBase.ts:48:1 no-restricted-imports '../assets/svg/profiler-configuration-colored.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use t
🟡 src/utils/GlobalSettingsClassBase.ts:49:1 no-restricted-imports '../assets/svg/query-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/GlobalSettingsClassBase.ts:50:1 no-restricted-imports '../assets/svg/roles-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated
🟡 src/utils/GlobalSettingsClassBase.ts:51:1 no-restricted-imports '../assets/svg/search-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designate
🟡 src/utils/GlobalSettingsClassBase.ts:52:1 no-restricted-imports '../assets/svg/search-index-colored-new.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the des
🟡 src/utils/GlobalSettingsClassBase.ts:53:1 no-restricted-imports '../assets/svg/setting-access-control.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the desig
🟡 src/utils/GlobalSettingsClassBase.ts:54:1 no-restricted-imports '../assets/svg/setting-custom-properties.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the de
🟡 src/utils/GlobalSettingsClassBase.ts:55:1 no-restricted-imports '../assets/svg/setting-data-observability.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the d
🟡 src/utils/GlobalSettingsClassBase.ts:56:1 no-restricted-imports '../assets/svg/setting-management.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designate
🟡 src/utils/GlobalSettingsClassBase.ts:57:1 no-restricted-imports '../assets/svg/setting-notification.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:58:1 no-restricted-imports '../assets/svg/setting-services-omd.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designa
🟡 src/utils/GlobalSettingsClassBase.ts:59:1 no-restricted-imports '../assets/svg/settings-sso.svg' import is restricted from being used by a pattern. Do not import SVG icons directly from assets/ paths; use the designated abst

… and 14 more. Run make ui-checkstyle-changed locally for the full list.


Fix locally (fast - only checks files changed in this branch):

make ui-checkstyle-changed

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

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

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Hide Login configurations when SSO is enabled

3 participants