Dear all,
I am trying to get artifact resolution working between an SP and IDP both using simplesamlphp 2.3.5. The SP and IDP are able to correctly complete single sign on using HTTP_REDIRECT. For information, though I don't think it's relevant, the IDP is using memcached as its store, the SP sql. Excerpts from the various configuration files are given at the end. This question is unfortunately quite long as I have attempted to include everything relevant.
Firstly (and not the main issue) I cannot get the metadata on the IDP through the Federation page when logged in to the simplesaml admin page, nor from the metadata URL. Configuration.php function getDefaultBinding throws a "Missing default binding for ArtifactResolutionService" in saml20-idp-hosted exception. I added
case 'saml20-idp-hosted:ArtifactResolutionService':
return BINDING_SOAP;
to the switch in function getDefaultBinding which least allowed metadata the SP needs to be generated. Changing the binding it returns does not affect the following problem.
There is a post on google groups about the metadata generation problem here
https://groups.google.com/g/simplesamlphp/c/7FGqWUsnp2I but it concludes with an "everything works fine" once they got the artifact resolution endpoint from the idp. In my case it doesn't.
So, with the metadata exchanged, when I attempt to initiate a signon at the SP, either from my test page that calls requireAuth or when logged in to the simplesaml admin interface on the SP and using its Test page, I get an exception that it "Could not find a supported SingleSignOnService endpoint." from Configuration.php (SimpleSAML\Configuration::getDefaultEndpoint) on the SP. The IDP is never reached.
This seems to be because the SP authsources.php contains (per the documentation page "Using HTTP-Artifact from a SimpleSAMLphp SP") the following line
'ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
for this SP configuration, but saml20-idp-remote.php on the SP has
'SingleSignOnService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => '
https://artifiacttest.idplocal.example/saml20idp/module.php/saml/idp/singleSignOnService',
],
],
for the artifact test idp. This comes from the metadata published by the idp, where 'saml20.sendartifact' => true is configured in the relevant section of the saml20-idp-hosted file. All this is per the documentation on configuring artifact on simplesamlphp running as SP or IDP as appropriate.
Digging into it a bit more, it looks like getDefaultEndpoint in Configuration.php can't find an endpoint based on the following input
$endpoints is an array containing:
[Binding] => urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
[Location] =>
https://artifiacttest.idplocal.example/saml20idp/module.php/saml/idp/singleSignOnService $bindings is an array containing:
[0] => urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact
As an aside, if I change the binding in (SP) saml20-idp-remote.php from HTTP-Redirect to HTTP-Artifact then the exception is not generated and a request is sent to module.php/saml/idp/singleSignOnService at the idp, passing a SAMLart variable, rather than the expected SAMLRequest variable. This is also wrong as the IdP (as far as I can tell) then thinks it is an SP receiving an artifact and tries to find the required remote IDP to call its artifact resolution service, which it clearly can't.
I am now stuck and would be grateful if anyone can offer any insight.
Here are excepts from the relevant configuration files
On the SP authsources.php contains
$config['artifacttest'] = [
'saml:SP',
'entityID' => '
https://artifacttest.splocal.example',
'idp' => 'artifacttestIdp',
'ProtocolBinding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
];
On the SP saml20-idp-remote.php contains (these are copied and pasted from the idp admin interface)
$metadata['artifiacttestIdp'] = [
'metadata-set' => 'saml20-idp-hosted',
'entityid' => 'artifiacttest',
'SingleSignOnService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => '
https://artifiacttest.idplocal.example/saml20idp/module.php/saml/idp/singleSignOnService',
],
],
'SingleLogoutService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => '
https://artifiacttest.idplocal.example/saml20idp/module.php/saml/idp/singleLogout',
],
],
'NameIDFormat' => [
'urn:oasis:names:tc:SAML:2.0:nameid-format:transient',
],
'ArtifactResolutionService' => [
[
'index' => 0,
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP',
'Location' => '
https://idplocal.example/saml20idp/module.php/saml/idp/artifactResolutionService',
],
],
'contacts' => [
[
'emailAddress' => '
sup...@example.com',
'givenName' => 'Administrator',
'contactType' => 'technical',
],
],
'certData' => 'snipped',
];
On the IDP saml20-idp-hosted.php contains
$metadata['artifacttestIdp'] = [
'host' => 'artifiacttest.idplocal.example',
'privatekey' => 'artifiacttest.idplocal.example.key',
'certificate' => 'artifiacttest.idplocal.example.pem',
'auth' => 'example-userpass',
'saml20.sendartifact' => true,
];
On the IDP saml20-sp-remote.php (copied and pasted from the SP admin interface)
$metadata['
https://artifacttest.splocal.example'] = [
'SingleLogoutService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
'Location' => '
https://splocal.example/saml20sp/module.php/saml/sp/saml2-logout.php/artifacttest',
],
],
'AssertionConsumerService' => [
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
'Location' => '
https://splocal.example/saml20sp/module.php/saml/sp/saml2-acs.php/artifacttest',
'index' => 0,
],
[
'Binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact',
'Location' => '
https://splocal.example/saml20sp/module.php/saml/sp/saml2-acs.php/artifacttest',
'index' => 1,
],
],
'certData' => 'snipped',
];
Regards,
Mark