fix(saml): support Azure SAML 'Sign assertion only' configuration#5275
Conversation
Azure AD/Entra ID can be configured with different SAML signing options: - Sign SAML assertion (only the assertion is signed) - Sign SAML response and assertion (both are signed) Previously, Infisical's SAML implementation expected both the response and assertion to be signed (node-saml default). This caused 'Invalid document signature' errors for customers using 'Sign SAML assertion' only, which is a common enterprise configuration. This fix sets wantAuthnResponseSigned to false for Azure SAML, which: - Allows 'Sign SAML assertion' configurations to work - Still validates the assertion signature for security - Remains compatible with 'Sign SAML response and assertion' configs This is consistent with how other providers are handled (JumpCloud already sets wantAuthnResponseSigned=false, Google/Auth0 set wantAssertionsSigned=false). Co-Authored-By: Vlad Matsiiako <vm265@cornell.edu>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Greptile OverviewGreptile SummarySets Key changes:
The change is narrow in scope, well-documented with inline comments, and addresses a legitimate enterprise use case where Azure IdPs are configured to sign only the SAML assertion rather than the entire response envelope. Confidence Score: 4/5
Important Files Changed
|
carlosmonastyrski
left a comment
There was a problem hiding this comment.
LGTM, reproduced the same issue without the wantAuthnResponseSigned property, and confirmed it'll work the same for both flows
Context
Fixes SAML authentication failures for Azure AD/Entra ID customers who have their SAML signing option configured to "Sign SAML assertion" (rather than "Sign SAML response and assertion").
Before: Customers using Azure SAML with "Sign SAML assertion" only would receive
Invalid document signatureerrors because node-saml expected the SAML response envelope to be signed.After: Both "Sign SAML assertion" and "Sign SAML response and assertion" configurations work correctly.
This is consistent with how JumpCloud SAML is already handled in the codebase (line 82), which also sets
wantAuthnResponseSigned = false.Steps to verify the change
Human Review Checklist
wantAuthnResponseSigned = falsestill validates the assertion signature (the assertion contains the user identity claims and is the security-critical part)Type
Checklist
Link to Devin run: https://app.devin.ai/sessions/1a3839a54ee842979a623083011aa47f
Requested by: Vlad Matsiiako (@vmatsiiako)