Repository navigation
Fixes #37056: SAML trust, Test Login parity and query-cost access checks - #38219
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
| List<X509Certificate> valid = new ArrayList<>(); | ||
| Date now = new Date(); |
There was a problem hiding this comment.
New Java locals that are never reassigned lack final. The repository requires final on unchanged locals and parameters. Apply it to valid and now here, errors in TestLoginAccountChecks.check, and the same pattern elsewhere in the added Java code. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| 'ui:help': | ||
| 'Auto-generated Service Provider Entity ID. Copy this value and paste it as Entity ID in your SAML Identity Provider configuration.', | ||
| 'Defaults to the application URL. You can change it to match the Identifier (Entity ID) configured in your SAML Identity Provider.', |
There was a problem hiding this comment.
The new help messages for SP Entity ID and Assertion Consumer Service URL are hard-coded in English. The repository requires every user-facing string to use translation keys, including help text. Translate both messages so they follow the administrator's selected language. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
The whole SAML settings form is in English today: 18 of its titles and help texts are plain strings, and only the encryption label is translated. This PR only rewrote two help texts that were already English, so translating just those would leave the form half translated. Translating the full SAML form is better done as a separate change.
There was a problem hiding this comment.
You're right — requiring translation for just these 2 strings when the entire SAML form is untranslated would create an inconsistent half-translated state. It makes more sense to handle the full form translation as a separate effort rather than piecemeal in this PR.
Got it. Shall I remember this as a rule: "Don't flag individual untranslated strings if the entire component/form is already untranslated; full component translation should be a separate change to avoid inconsistent partial translation"?
manerow
left a comment
There was a problem hiding this comment.
ui-coverage-tests fails: useSsoConfiguration.test.ts:269 and :300 expect the literal "Require Encrypted Assertions" but now get label.require-encrypted-assertions.
Note for 2.0: #38197 merged the earlier version of this code, so the 2.0 branch still fails to start when every saved IdP certificate has expired. The fixes from this PR need to reach 2.0 before 2.0.10 ships.
| try { | ||
| requireAdmitted(candidate, result, users); | ||
| } catch (AuthenticationException e) { | ||
| result.withStatus(TestLoginResult.Status.FAILED); | ||
| final List<String> errors = new ArrayList<>(result.getErrors()); | ||
| errors.add(e.getMessage()); | ||
| result.setErrors(errors); | ||
| result.getStages().stream() | ||
| .filter(stage -> stage.getStage() == TestLoginStage.IDENTITY_RESOLVED) | ||
| .forEach( | ||
| stage -> stage.withStatus(TestLoginStageStatus.FAILED).withMessage(e.getMessage())); |
There was a problem hiding this comment.
Account checks mix separate jobs
check combines account checks with rewriting errors and timeline stages. The repository requires methods to stay around 15 lines and do one named job. Extract the failed-result update into a helper. The same split would help admitOidc, which combines account lookup, subject checks and signup fallback.
This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| }, | ||
| "idpX509Certificate": { | ||
| "description": "X509 Certificate ", | ||
| "description": "IdP signing certificate(s): a PEM certificate or concatenated PEM bundle; a single base64 DER certificate is also accepted. At least one currently valid certificate is required for configuration validation. Expired keys are excluded when settings are built; future rollover keys are retained.", |
There was a problem hiding this comment.
Certificate help describes old behavior
The description says expired keys are excluded when settings are built, but putIdpCertificates now deliberately retains them. Administrators could leave an expired key configured because this text says it is no longer trusted.
Update the source description and regenerate its UI copies to say that retiring a key requires removing it from the configuration.
| }, | ||
| "idpX509Certificate": { | ||
| "description": "X509 Certificate ", | ||
| "description": "IdP signing certificate(s): a PEM certificate or concatenated PEM bundle; a single base64 DER certificate is also accepted. At least one currently valid certificate is required for configuration validation. Expired keys are excluded when settings are built; future rollover keys are retained.", |
There was a problem hiding this comment.
⚠️ Quality: Cert field description says expired keys are dropped; runtime keeps them
The new idpX509Certificate description says "Expired keys are excluded when settings are built; future rollover keys are retained." That matches the v1 rule, which the Accepted ADR 2026-11-20-saml-runtime-trust-preserves-configured-signing-keys has since superseded. SamlSettingsHolder.putIdpCertificates now calls SamlCertificates.parse and keeps every configured certificate, expired ones included (see preservesExplicitlyConfiguredKeysAtRuntime). The same text is in the source spec schema, in both copies in the UI JSON schema, and in every regenerated TS client. It contradicts the record, and it tells admins the opposite of what they need to know: the ADR says retired keys stay trusted until removed, but this description says expiry removes them on its own. Fix: reword the description in samlSSOClientConfig.json and the UI authenticationConfiguration.json, then regenerate the TS types.
Align the description with the runtime-trust ADR (apply in both schemas, then regenerate the TS types):
"description": "IdP signing certificate(s): a PEM certificate or concatenated PEM bundle; a single base64 DER certificate is also accepted. At least one currently valid certificate is required for configuration validation. All configured certificates, including expired and future rollover keys, are trusted at runtime; remove retired keys explicitly.",
Was this helpful? React with 👍 / 👎
Code Review
|
| Compact |
|
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source
…SAML browser callback (backport #38219) (#38441) * fix: address SAML startup and callback review findings * test: match translated SAML encryption label * style: mark unchanged SAML and Test Login locals final * Describe that runtime SAML trust keeps expired IdP certificates * Replace a SAML browser callback that an earlier save set to the ACS URL * Keep the saved SSO configuration out of the form cleanup * Keep the base path in the SAML browser callback fallback * Keep a usable saved SAML callback when the other one is the ACS URL * Keep a configured authorizer class and request filter when saving SSO settings --------- Co-authored-by: mohitdeuex <[email protected]>
Describe your changes
Fixes #37056.
Azure metadata can publish multiple signing certificates, and Test Login must reject the same accounts and encryption mismatches as live sign-in. This fixes certificate import/trust, assertion-encryption enforcement, Test Login admission and cleanup, and query-cost search access fields. The setup redesign and certificate-upload UX are deferred until the fix PRs merge.
Type of change
High-level design
Editable SAML SP fields follow-up
SP Entity ID and ACS URL retain their generated defaults but can be edited. The edited ACS takes precedence over the hidden callback when building Save and Test Login payloads; custom entity IDs and URLs survive cleanup/reload. Help text explains matching the identity provider configuration.
Tests
Backend integration tests
Focused protocol tests exercise a real in-process LDAP server and OIDC provider; the mapping probe used local Elasticsearch. Full database-backed integration suites were not run.
Ingestion integration tests
Not applicable — no ingestion changes.
Playwright tests
Not run locally; callback routing has a Vite HTTP regression.
Manual testing
Rebuilt 2.0 a6eccab was tested with real Azure sign-in, two IdP certificates, signed AuthnRequests and strict mode disabled: the unregistered account was rejected with signup disabled; optional encryption succeeded with signup allowed in the unsaved candidate; required encryption rejected Azure's plaintext assertion at TOKEN_VALIDATED. Static checks passed, as expected. Saved authentication remained Basic and no account was created. Main itself is verified by the focused build/tests above.
UI screen recording
Not applicable — correctness fixes and exposure of an existing security setting; the setup redesign remains deferred.
Checklist
Test Login migration release alignment
Move the existing MySQL and PostgreSQL Test Login DDL unchanged from native/2.1.0 to native/2.0.10, matching the backport release. Counterparts: #38302 (2.1) and #38301 (2.0; corrects merged #38197).
Validated creation, repeated execution, preservation of an existing session, primary key and both secondary indexes using isolated MySQL 8.0 and PostgreSQL 16 containers. Exact SQL relocation and git diff --check passed; independent review of 539da72 found no blocking findings. The runner discovers the new version and selects unexecuted historical migrations even below 2.1.0; recorded SQL checksums skip statements already applied.
A focused MigrationWorkflowTest/MigrationWorkflowReprocessingTest attempt could not start because this sparse checkout lacks other Maven reactor modules; zero Java tests ran. Java runner and full application upgrade checks remain pending. Earlier application test results above predate this SQL-only commit.
Review follow-up (e77a5c2)
Addresses Adria/manerow's review findings and the related bot comments:
The remaining repository requirements on unchanged Java values and method responsibilities must be satisfied before merging.
Findings
Summary
This PR fixes SAML certificate bundles and encryption checks, brings Test Login closer to live sign-in, and adds query-cost fields used by search access checks.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD Candidate[Unsaved SSO settings] --> Check[Check configuration] Check --> Login[Test Login] Login --> Verify[Verify credentials or provider response] Verify --> Admission[Check account and signup rules] Admission --> Result[Return test result] Result --> Clear[Complete session and clear candidate secrets] Saved[Saved SAML settings] --> Trust[Load all configured signing certificates] Trust --> Response[Verify response and encryption policy]Reviews (16) · Last reviewed commit: "Merge main into fix/saml-azure-encryptio..." · Reviewed by Greptile