Hello
I’m using the latest SAML2 component for .net core and I could use it to integrate various IDPs.
I’m having an issue with the last one and I’m getting the following error :
The audience restriction https://XXX/security/xlogin/AssertionConsumerService doesn’t match the expected audience restriction https://XXX/.
My metadata are defined as following :
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="https://XXX/" ID="_b40cec4c-22b9-40bb-afe9-1da9ded46a5a"> <md:SPSSODescriptor ID="_6f27b819-a009-4e3d-b7e9-824dc3c10952" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" AuthnRequestsSigned="true" WantAssertionsSigned="true"> <md:KeyDescriptor> <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> <X509Data>
<X509Certificate>...</X509Certificate>
</X509Data>
</KeyInfo>
</md:KeyDescriptor>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location="https://XXX/security/xlogin/AssertionConsumerService" index="0" isDefault="true"/>
</md:SPSSODescriptor>
</md:EntityDescriptor>
If I check the log I can see in the response :
<saml2:AudienceRestriction><saml2:Audience>https://XXX/security/xlogin/AssertionConsumerService</saml2:Audience></saml2:AudienceRestriction>
My diagnostic is that the IDP is using the endpoint URL in place of the Entity Id. In fact they are using an old technology and are not using metadata.xml at all, the only piece they are using for configuration are the certificate file and the endpoint url.
Of course if I disable audience restriction check, everything is working fine, but this is supposed to be a security breach.
Is there a way to fine tune this check? Should I simply hack my EntityID for this specific IDP?