Fixes #30304: Prevent zero-lifetime OIDC login tokens - #33172
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated 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 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 |
Code Review ✅ Approved 1 resolved / 1 findingsFixes infinite OIDC login loops caused by zero-lifetime tokens by adding schema validation, runtime fallback to 3600 seconds, and idempotent database migrations that repair corrupt persisted data. Comprehensive unit and integration tests confirm schema validation, migration safety, and runtime protection. No issues found. ✅ 1 resolved✅ Quality: Invalid tokenValidity on save returns HTTP 500 instead of 400
OptionsDisplay: compact → Counting what did not apply, without listing it. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
|



Describe your changes:
Fixes #30304
I fixed OIDC logins that loop forever when a persisted OpenMetadata access-token validity is zero, causing every newly issued JWT to have
exp == iat.Type of change:
High-level design:
OIDC token validity remains a persisted OpenMetadata JWT setting, but its schema now defaults to 3600 seconds and rejects values below 1. Configuration writes enforce the same constraint, runtime protects deployments with corrupt persisted data by falling back to 3600 seconds, and idempotent MySQL and PostgreSQL 2.0.2 migrations repair existing non-positive values. Provider-token inheritance was not used because OpenMetadata signs its own API JWT after OIDC authentication; the generated UI schema and provider guidance now make that ownership explicit.
Tests:
Use cases covered
Unit tests
OidcTokenValidityTest.java,SystemRepositoryOidcTokenValidityTest.java,OidcTokenValiditySqlMigrationTest.javaOidcTokenValidity.javacoverage: 100% lines, 100% branchesSSOConfigurationForm.test.tsxSSO.constant.tscoverage: 100% lines, 90% branchesBackend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
openmetadata_settingsrows/api/v1/auth/refreshreturned a JWT withexp - iat = 3600and that the refreshed token returned 200 fromloggedInUserUI screen recording / screenshots:
TODO: Attach a before/after screenshot of the renamed OpenMetadata Access Token Validity field before marking this PR ready for review.
Checklist:
Fixes <issue-number>: <short explanation>Fixes #<issue-number>above.Bug fix