Skip to content

fix(saml): support Azure SAML 'Sign assertion only' configuration#5275

Merged
carlosmonastyrski merged 1 commit intomainfrom
devin/1769467042-fix-azure-saml-signing
Jan 27, 2026
Merged

fix(saml): support Azure SAML 'Sign assertion only' configuration#5275
carlosmonastyrski merged 1 commit intomainfrom
devin/1769467042-fix-azure-saml-signing

Conversation

@devin-ai-integration
Copy link
Contributor

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 signature errors 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

  1. Configure Azure AD/Entra ID SAML SSO with signing option set to "Sign SAML assertion"
  2. Attempt to log in via SAML SSO
  3. Verify authentication succeeds without "Invalid document signature" error

Human Review Checklist

  • Verify that setting wantAuthnResponseSigned = false still validates the assertion signature (the assertion contains the user identity claims and is the security-critical part)
  • Confirm this change is backward compatible with existing Azure SAML configurations using "Sign SAML response and assertion"

Type

  • Fix
  • Feature
  • Improvement
  • Breaking
  • Docs
  • Chore

Checklist


Link to Devin run: https://app.devin.ai/sessions/1a3839a54ee842979a623083011aa47f
Requested by: Vlad Matsiiako (@vmatsiiako)

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-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@maidul98
Copy link
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 26, 2026

Greptile Overview

Greptile Summary

Sets wantAuthnResponseSigned = false for Azure SAML to support Azure AD/Entra ID's "Sign SAML assertion" configuration option, mirroring the existing JumpCloud implementation.

Key changes:

  • Allows Azure customers to use "Sign assertion only" signing option without receiving "Invalid document signature" errors
  • Maintains backward compatibility with "Sign SAML response and assertion" configuration
  • Assertion signatures are still validated via node-saml's default behavior (security is maintained)
  • Follows the pattern already established for JumpCloud SAML on line 82

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

  • This PR is safe to merge with minimal risk - it follows established patterns and maintains cryptographic validation
  • The change mirrors the existing JumpCloud implementation (line 82), is well-documented with inline comments explaining the Azure SAML behavior, and maintains security by still validating assertion signatures. The only minor concern is the existing JSON.parse on line 90 lacks error handling (pre-existing issue, not introduced by this PR)
  • No files require special attention - the change is a simple configuration flag addition

Important Files Changed

Filename Overview
backend/src/ee/routes/v1/saml-router.ts Added wantAuthnResponseSigned = false for Azure SAML to support 'Sign assertion only' configuration; mirrors JumpCloud implementation

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@carlosmonastyrski carlosmonastyrski left a comment

Choose a reason for hiding this comment

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

LGTM, reproduced the same issue without the wantAuthnResponseSigned property, and confirmed it'll work the same for both flows

@carlosmonastyrski carlosmonastyrski merged commit 735a585 into main Jan 27, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants