Dynamic SAML provider can never sign AuthnRequests (WantAuthnRequestsSigned hardcoded to false) #626
Replies: 4 comments 9 replies
|
Ha! Passing it on to dev team indeed, but no promises (digging into it though) |
|
@jwalker-hw Duende IdentityServer v8.0.8 has been released. _ = isBuilder
.AddSamlDynamicProvider()
.AddInMemorySamlProviders([
new()
{
Scheme = "saml-idp",
DisplayName = "External Identity Provider",
Enabled = true,
IdpEntityId = "https://idp.example.org/saml/metadata/123456",
SingleSignOnServiceUrl = "https://idp.example.org/saml2/sso/123456",
SigningCertificateBase64 = "...base64-encoded cert...",
+ AuthnRequestSigningBehavior = AuthnRequestSigningBehavior.Always
}
]); |
|
Thanks for the quick turnaround — 8.0.8 works. However, when I took it to a live Okta tenant today, I hit something I can't explain. Okta has our SP certificate uploaded and "Validate SAML requests with signature certificates" enabled; entity ID and ACS match exactly. The only variable below is that toggle:
In the failing runs, Okta parses the request, resolves the right app, evaluates its sign-on policy and authenticates the user - then never emits the SSO event and never logs a reason. My user just lands on the Okta dashboard. I verified the signature two ways against the same certificate Okta holds.
So the bytes look right by every check I can run from outside. Is there anything 8.0.8 emits that a verifying IdP could legitimately reject that those two checks would miss? The things I can't rule out from here are the I'd be happy to send a full unredacted request and the certificate privately. |
|
@wcabus - any movement on this? Trying to decide whether we're shipping our first version without signing SAML responses. ( It's ok if we do ) . But I was waiting just in case a new patch was available shortly. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Version: 8.0.7
A SAML dynamic provider configured with SpSigningCertificateBase64 and SpSigningCertificatePassword sends unsigned AuthnRequests. The redirect to the IdP carries SAMLRequest and RelayState but no SigAlg or Signature.
As far as I can tell this can't be configured around. In SamlConfigureOptions.BuildIdentityProvider:
SPOptions.AuthenticateRequestSigningBehavior defaults to IfIdpWantAuthnRequestsSigned, nothing in the dynamic path changes it (PostConfigureSaml2OptionsForDynamic only sets up a logger and a cookie manager), and SamlProvider exposes no property that maps to either. So the condition is always false.
The certificate is loaded, and the doc comment on SpSigningCertificateBase64 says it signs "outbound SAML messages (AuthnRequests, LogoutResponses)... Required when the remote IdP expects signed requests", which is what led us to expect signing to work.
Repro
Register a saml2 dynamic provider with an SP signing certificate, start an SP-initiated sign-in, and inspect the redirect. No signature parameters.
Ask
Could SamlProvider expose the signing behavior, or could WantAuthnRequestsSigned come from the provider model? Static SP registration can reach AuthenticateRequestSigningBehavior, but dynamic providers are the whole reason we're registering IdPs per customer. If the hardcoded value is deliberate, it would help to say so in the SpSigningCertificateBase64 docs, since they currently read as though request signing is supported.
@maartenba - only because you jumped on this so fast last time. ;)
All reactions