Skip to content

[#358] Support ECDSA-SHA256 for SAML XML signatures - #1271

Open
vharseko wants to merge 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/358-saml2-ecdsa-xml-signing
Open

vharseko wants to merge 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/358-saml2-ecdsa-xml-signing

Conversation

@vharseko

@vharseko vharseko commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

An IdP configured with an EC signing key can fail to sign a SAML assertion because the federation service defaults to RSA-SHA1. The XML signature settings did not offer ECDSA. With the signing algorithm unset, the SAML 2 provider also reused the algorithm selected for an earlier key. Discussion #358

This change adds ECDSA-SHA256 to the XML signature algorithm setting for new and upgraded installations. Upgrades preserve the selected algorithm and any locally added choices. When the setting is empty, the signer chooses the algorithm for each private key and retains the existing RSA and DSA defaults. An explicitly configured URI takes precedence for every SAML 2 XML signing key. The setting’s help now explains that all federation XML signing keys must support the selected algorithm and that ECDSA-SHA256 requires EC keys throughout. If signing fails, the SAML 2 error includes the method and key type.

Regression tests cover switching key types on one provider, an EC key in a certificate issued by an RSA CA, explicit configuration, and upgrading a customized schema twice. All 955 tests in the federation library, OpenFM, and upgrade modules passed on JDK 11.

@vharseko
vharseko requested a review from maximthomas December 1, 2026 15:36
@vharseko vharseko added bug saml SAML / SAML2 federation java Pull requests that update java code tests Test suite: coverage, fixtures, or test infrastructure labels Dec 1, 2026

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The RSA-issued EC certificate test verifies both the ECDSA-SHA256 method and the signature itself, which pins selection to the signing key.


suggestion (non-blocking): Clarify that the selected XML signature algorithm applies to all signing keys.

famFederationCommon.properties:93

The new help tells an administrator to select ECDSA-SHA256 for an EC key. The Global schema stores one URI, and the shared SAML 2 signer uses that URI for every private key. A JDK 11 check confirmed that the same provider signs with EC and rejects RSA when configured for ECDSA-SHA256. State in the help that every XML signing key must support the selected method. Global schema · Configured method selection ·

@vharseko

vharseko commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

@maximthomas I updated the XML signature algorithm help in 367cb1d. It now tells administrators to choose an algorithm that every federation XML signing key supports and to select ECDSA-SHA256 only when all those keys are EC keys.

@vharseko
vharseko requested a review from maximthomas December 1, 2026 16:06

@maximthomas maximthomas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: The English help now tells administrators to choose a method that every federation XML signing key supports and to select ECDSA-SHA256 only when all those keys are EC keys. Updated help

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

Labels

bug java Pull requests that update java code saml SAML / SAML2 federation tests Test suite: coverage, fixtures, or test infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants