DisableAudienceRestrictionCheck attribute isn't working

For a bad configuration of Idp, where I’m having an issue of wrong URI format, and to not stop my working I tried to use the property DisableAudienceRestrictionCheck as a workaround, but it didn’t make the component stop to validate the Audience Restriction Check.

dbug: ComponentSpace.Saml2.Utility.XmlSchema[0]
The ‘urn:oasis:names:tc:SAML:2.0:assertion:Audience’ element is invalid - The value ‘http://srv-stg-app1.infra-nprd.com:Legacy’ is invalid according to its datatype ‘http://www.w3.org/2001/XMLSchema:anyURI’ - The string ‘http://srv-stg-app1.infra-nprd.com:Legacy’ is not a valid Uri value.

I have included the option in the appConfig file → “DisableAudienceRestrictionCheck”: true,
In a second try, I have added this option via code in the startup as well

The DisableAudienceRestrictionCheck disables the check of the audience restriction condition against the configured local provider name.

The exception you’re seeing has occurred before this check. We check the received SAML message against the SAML XML schema and this check is failing.

According to the SAML XML schema, the Audience value should be a URI. The actual value “<a href=“http://srv-stg-app1.infra-nprd.com:Legacy””>http://srv-stg-app1.infra-nprd.com:Legacy" isn’t a URI.

Is “<a href=“http://srv-stg-app1.infra-nprd.com:Legacy””>http://srv-stg-app1.infra-nprd.com:Legacy" the value you supplied to the IdP as the provider name (aka entity ID)?

If so, I recommend changing this to a legal URL (eg “<a href=“http://srv-stg-app1.infra-nprd.com/Legacy")">http://srv-stg-app1.infra-nprd.com/Legacy”) and providing this to the IdP and updating your LocalServiceProviderConfiguration.Name.

If this isn’t possible, you’ll have to disable the XML schema check by setting the LocalServiceProviderConfiguration.DisableSchemaCheck to true.

For example:

“LocalServiceProviderConfiguration”: {
“Name”: “<a href=“https://ExampleServiceProvider”,”>https://ExampleServiceProvider”,
“Description”: “Example Service Provider”,
“DisableSchemaCheck”: true,