-
Notifications
You must be signed in to change notification settings - Fork 44
Description
I have a problem getting IDP-initiated logoff configured with SAML2.
The Dutch DigiD IDP is specified to send my SP a SOAP call for an IDP-initiated logoff.
This is a fragment of sample SP metadata, taken from the DigiD spec.
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="http://test.local/saml/sp/logged_out"/>
<md:SingleLogoutService Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="http://test.local/saml/sp/logout"/>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact" Location="http://test.local/saml/sp/artifact_resolution" index="0"/>
There does not seem to a way to achieve this using the SAML2 package..
The config can have just the one endpoint with type "Logout".
When I specify SOAP I get two identical SOAP entries in the metadata.
And when I specify Redirect, I get entries for REDIRECT and POST, but no SOAP.
I believe the code that handles this is in Saml20MetadataDocument.cs:
else if (endpoint.Type == EndpointType.Logout)
{
var logoutEndpoint = new Endpoint
{
Location = new Uri(baseUrl, endpoint.LocalPath).ToString()
};
logoutEndpoint.ResponseLocation = logoutEndpoint.Location;
logoutEndpoint.Binding = GetBinding(endpoint.Binding, Saml20Constants.ProtocolBindings.HttpPost);
logoutServiceEndpoints.Add(logoutEndpoint);
// TODO: Look at this...
logoutEndpoint = new Endpoint
{
Location = new Uri(baseUrl, endpoint.LocalPath).ToString()
};
logoutEndpoint.ResponseLocation = logoutEndpoint.Location;
logoutEndpoint.Binding = GetBinding(endpoint.Binding, Saml20Constants.ProtocolBindings.HttpRedirect);
logoutServiceEndpoints.Add(logoutEndpoint);
var artifactLogoutEndpoint = new IndexedEndpoint
{
Binding = Saml20Constants.ProtocolBindings.HttpSoap,
Index = endpoint.Index,
Location = logoutEndpoint.Location
};
artifactResolutionEndpoints.Add(artifactLogoutEndpoint);
}
When a binding is specified in the config, both calls to GetBinding() produce SingleLogoutService entries with this binding in the metadata, resulting in duplication.
The above code does produce an ArtifactResolutionService element with SOAP binding, but that is not what the DigiD spec requires.
Perhaps the simplest, and most versatile solution would be for SAML2 to allow configuration of the exact metadata required.
For the record.. I have changed the above code to produce the metadata DigiD requires. But still, DigiD does not send me the expected SOAP call. I assume that to be a problem with DigiD, but it could be an error in their spec.
It puzzles me that SAML2 unconditionally adds a ArtifactResolutionService element for logout that binds to SOAP. Is this to support some common practise?
Why would DigiD divert from this?