Repository navigation
Fixes 28619: Accept Okta SAML certificates whose CN is the org name - #33446
Conversation
SamlValidator required the IdP certificate's CN to equal the Entity ID host. Okta Entity IDs are always http://www.okta.com/{appId} — a format validateBasicSamlConfig itself enforces — so the host is always the literal www.okta.com, while Okta issues signing certificates with CN=<org short name>. The branch was unsatisfiable, so every legitimate Okta configuration was rejected on save. The only passing value was a CN of literally *.okta.com, which Okta never issues and which was the sole case the existing test covered. The check had no security value: the certificate is a trust anchor taken from the IdP's own metadata and handed to OneLogin's IDP_X509CERT_PROPERTY_KEY, and SAML verifies signatures against its public key without PKIX name validation, so the CN is never consulted. The Auth0, Azure and non-Azure branches encoded the same assumption and broke on Auth0 custom domains and on any change to Microsoft's certificate naming, so all four collapse into the warn-and-continue path that already existed for generic providers. A CN differing from the Entity ID host logs at INFO — it is the expected shape for these providers, so warning would train operators to ignore warnings. Parsing and the validity window are still enforced. Also scopes bean validation on PUT /system/security/config to the active provider. @Valid cascaded into every nested block present, so an instance carrying a partial ldapConfiguration could not save a SAML configuration and a GET response was not accepted by PUT unchanged. Validation now runs against a copy with inactive providers' blocks nulled, and IllegalArgumentException is rethrown ahead of the blanket catch so an invalid configuration answers 400 rather than 500. Co-Authored-By: Claude Opus 5 <[email protected]>
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Scope provider validation on the validate endpoint too, key the OIDC block on clientType, and close the gaps the review found in the tests. - POST /system/security/validate dropped @Valid and now runs the same provider-scoped validation as PUT. It is the first call the SSO form makes on save, so the inactive-block cascade still rejected the request there before PUT was ever reached. - oidcConfiguration is not only the OIDC providers' block but the confidential client's, so clearing it now tests clientType alongside the usesOidcConfiguration check added in the previous commit. A partial block left behind by an earlier confidential setup no longer blocks a public-client save. - Validation runs against the instance that is persisted rather than a Jackson deep copy. The round trip re-applied the schema defaults jsonschema2pojo emits as field initializers, leaving a @NotNull field that has a default unenforced on the object actually saved — `provider` is @NotNull and defaults to `basic`, so a payload sending it as null was accepted and stored. - Narrowed the rethrow to BadRequestException, so a failure from the writes that follow is not reported to the admin as a 400. - SamlValidator guards a null Entity ID instead of relying on an NPE into a catch-all. - The Playwright route stubs only the PUT; the page's own GET reaches the server again, which enableSSOEditMode branches on. - SamlSecurityConfigIT restores the configuration in a finally in the active-provider rejection test, covers the saml and oidc scoping branches, stops destroying the LDAP password its restore depends on, and uses an Auth0 certificate in the Auth0 custom-domain test. - Jest covers a line-wrapped certificate, the shape real Okta metadata publishes. Co-Authored-By: Claude Opus 5 <[email protected]>
| await page.route('**/api/v1/system/security/config', (route) => | ||
| route.request().method() === 'PUT' | ||
| ? route.fulfill({ status: 200, json: {} }) | ||
| : route.fallback() | ||
| ); |
There was a problem hiding this comment.
When the test server already has a security configuration, allowing this GET to reach the real server makes the form use its existing-configuration PATCH path. That path does not call /security/validate, but the test unconditionally waits for that POST, so it times out instead of testing the Okta certificate flow. Keep the initial state deterministic or wait for the request associated with the selected save path.
Code Review ✅ Approved🟡 Medium risk Fixes SAML certificate validation to accept valid Okta, Auth0, and Azure configurations by removing provider-specific CN checks that had no security value and broke legitimate deployments. Also scopes bean validation to the active authentication provider so configurations carrying inactive LDAP, SAML, or OIDC blocks can be saved without false rejections. Includes unit tests, backend integration tests, and Playwright coverage for the regression and related cases. No issues found. 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 |
|
|
🚦 Removed from the merge queue —
|
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |
|
🤖 Backport to |



Describe your changes:
Fixes #28619
SamlValidatorrejected valid Okta SAML configurations because it required the IdP certificate'sCommon Name to equal the Entity ID host. Okta Entity IDs are always
http://www.okta.com/{appId}— a format
validateBasicSamlConfigitself enforces — so the host is always the literalwww.okta.com, while Okta issues application signing certificates withCN=<org short name>. Thetwo are different namespaces by Okta's design, so the branch was unsatisfiable and every
legitimate Okta configuration was rejected on save with:
The only value that could pass was a CN of literally
*.okta.com, which Okta never issues — andwhich was the sole case the existing unit test covered. That is why this shipped.
The check had no security value. The IdP certificate is a trust anchor the admin copies out of
the IdP's own metadata; it is handed to OneLogin's
SettingsBuilder.IDP_X509CERT_PROPERTY_KEY(
SamlSettingsHolder.java) and used to verify assertion signatures against its public key. SAMLperforms no PKIX name validation, so the CN is never consulted at authentication time. The rule was
a guess about vendor naming conventions, not a control.
The same defect was armed in the sibling branches, so all of them are fixed together:
CN == entityIdDomain || CN == "*.okta.com"CN == entityIdDomainexactlyCN.contains("Microsoft Azure")CNcontainingMicrosoft AzureChanges
SamlValidator— the four throwing branches collapse into the warn-and-continue path thatalready existed for generic providers. A CN that differs from the Entity ID host is logged at
INFO (not WARN: it is the expected shape for Okta, Auth0 custom domains and Azure, so warning
on every valid configuration would just train operators to ignore warnings). The checks that
carry meaning are untouched — the certificate must still parse as X.509 and be inside its
validity window. Net −107/+61 lines, and the method now fits the repo's nesting/complexity rules.
SystemResource.updateSecurityConfig— scopes bean validation to the active provider.@Validcascades into every nested block present in the payload regardless ofprovider, so aninstance carrying a partially-filled
ldapConfigurationcould not save a SAML configuration; itwas rejected over required LDAP fields the active provider never reads. That also made
GETresponses un-resubmittable, since
GETomits fields the cascade demanded:Validation now runs against a deep copy with inactive providers' blocks nulled, so everything
else is still enforced and only the bug changes.
oidcClientConfighas required fields too, soall three blocks are scoped, not just LDAP.
IllegalArgumentExceptionis rethrown ahead of themethod's blanket
catch (Exception)so an invalid configuration answers 400, not 500.Type of change:
High-level design:
N/A — small change.
Tests:
Use cases covered
metadata.xmlin SSO settings and saves: the configuration is acceptedinstead of being rejected on the IdP certificate field.
Why the existing tests missed this. All three layers already covered the
metadata.xmluploadand all three stopped one step short of the failure, which is in the save that follows the upload:
OKTA_METADATAhad the rightentityID, but a 28-char fake certificate asserted only withtoBeDefined()— never parseable, never had a CNprovider=BASICwith no SAML block, and asserted only that the response had astatus, not that it wasSUCCESSEvery new test below was confirmed red before the corresponding change and green after.
Unit tests
openmetadata-service/.../security/auth/validator/SamlValidatorTest.java— added the SAML config save fails: Okta IdP certificate wrongly rejected (validator requires cert CN to equal okta.com domain) #28619regression (Okta Entity ID + org-name CN) and an Auth0 custom-domain case, at both the full
validateSamlConfigurationpath and thevalidateIdpCertificateAgainstConfigunit level.Inverted the three tests that encoded the bug. Certificates are self-signed fixtures valid to
2036, matching the existing
GENERIC_CERTconvention — no new dependency.org.openmetadata.service.security.**sweep: 774/774, no regressions.Backend integration tests
openmetadata-integration-tests/.../SamlSecurityConfigIT.java(new, 7 tests) — drivesPOST /v1/system/security/validatewith the exact payloadparseSamlMetadataXmlproduces fromreal Okta metadata, and asserts both
status == successand that no error targetsauthenticationConfiguration.samlConfiguration.idp.idpX509Certificate. Also covers the Auth0custom-domain case, that expired and malformed certificates are still rejected, the
GET→PUTround trip, and both sides of the provider-scoped validation.
PUTtests write back only what they justread, never change the active provider, and restore the original in a
finally.SystemResourceIT(39) andConfigResourceIT(12) re-run clean — 58/58.Ingestion integration tests
Playwright (UI) tests
playwright/e2e/Features/SSOConfiguration.spec.ts+ newplaywright/test-data/saml-metadata-okta.xml— an Okta-shaped fixture with a real, parseable certificate, and a test that carries the upload
through to submit and asserts the IdP certificate is not rejected. It intercepts the persist call
so the run never repoints the instance at the fixture's IdP.
yarn lint:playwrightreports 0 errors; the spec is type-clean undertsc:playwright.available here. The same regression is covered at the layer where it actually fails by
SamlSecurityConfigIT, so this is belt-and-braces rather than the primary guard. Worth a run in CI.Manual testing performed
Not performed — the backend integration tests exercise the same API path the SSO form calls
(
POST /v1/system/security/validate) with the same payload, end to end against a real server viaTestcontainers.
UI screen recording / screenshots:
Not applicable — no user-facing UI change. The UI files touched are tests and a test fixture.
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 JSON Schema changes: no schema changes in this PR.
For UI changes: not applicable, no user-facing UI change.
I have added tests (unit / integration / Playwright as applicable) and listed them above.
I have added a test that covers the exact scenario we are fixing. Issue SAML config save fails: Okta IdP certificate wrongly rejected (validator requires cert CN to equal okta.com domain) #28619 is referenced in
SamlValidatorTest,SamlSecurityConfigITand theSamlValidatorjavadoc for future reference.🤖 Generated with Claude Code
The PR is not ready to merge because the Playwright regression can still time out without exercising validation, and the new backend integration class still violates the repository’s concurrency requirement.
Findings
Summary
Fixes SAML configuration validation by allowing provider-specific certificate naming conventions while retaining X.509 parsing and validity checks.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Admin submits security configuration] --> B[Preserve masked secrets] B --> C[Temporarily detach inactive provider blocks] C --> D[Run bean validation] D --> E[Restore detached blocks] E --> F{Configuration valid?} F -->|No| G[Return 400] F -->|Yes| H[Validate active SAML settings] H --> I[Parse X.509 certificate] I --> J[Check certificate validity window] J --> K[Log certificate naming differences] K --> L[Save and reload security configuration]Reviews (5) · Last reviewed commit: "Merge branch 'main' into fix/28619-okta-..."