* Tom Mount <
tmou...@gmail.com> [2014-07-11 00:07]:
> I set up SimpleSAMLphp to connect to a client's PingFederate IdP server (my
> application needs to provide their users a way to use their internal SSO).
> So far so good - they have my metadata, I have theirs, and I configured an
> authsource that, from the "Test authentication sources" page, successfully
> loads up their SSO login page, validates the testing account they provided,
> and then comes back...to a completely different page in my app than I
> expected.
From that it's hard to know whether the SAML assertion from the IDP
actually was transmitted to your (Simple)SAML(php)'s
AssertionConsumerURL location.
Use e.g. the Firefox SAMLtracer extension to see what happens.
Looks OK. Personally I always set the entityID myself to a sane value.
The autogenerated ones don't look very stable to me and are long and ugly.
> metadata/saml20-idp-remote.php:
>
> $metadata['
https://client.idp.url'] = array(
> > 'metadata-set' => 'saml20-idp-remote',
> > 'entityid' => '
https://client.idp.url',
> > 'SingleSignOnService' => array(
> > 0 => array(
> > 'Binding' => "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
> > 'Location' =>
> > "
https://client.idp.url/idp/startSSO.ping?PartnerSpId=http://my.app.url",
> > ),
> > 1 => array(
> > 'Binding' =>
> > "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect",
> > 'Location' =>
> > "
https://client.idp.url/idp/startSSO.ping?PartnerSpId=http://my.app.url",
> > ),
> > ),
> > 'certData' => 'etc'
> > 'NameIDFormat' =>
> > 'urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified',
> > );
OK. The SSO and SLO Locations are weird (making the endpoints on the
IDP specific to an SP) but that's probably just the way this
implementation works.
If "PartnerSpId" should be the entityID of your SP (as the name would
suggest to me) then this is probably not correct: Look at your SP's
admin interface to see what SSP autogenerates as its own SAML metadata
(unless you override it your authsources.php file).
> Where the Feide OpenIdP authsource goes back to the page from which it was
> called (the "Test authentication sources" page, in this case), my
> configured authsource goes to what's listed as 'PartnerSpId' in the SSO
> location above.
Trace the requests as described above to make sure where the SAML
response is being sent and who (the IDP or SSP after processing the
response) redirects you to the undesired URL.
> Changing that value in the metadata file breaks the entire
> process, so I'm guessing it's not getting the return URL from there. I've
> verified that my metadata has the following line:
>
> <md:AssertionConsumerService
> > Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
> > Location="http:/my.app.url/simplesaml/module.php/saml/sp/saml2-acs.php/foo-sp"
> > index="0"/>
>
> From my (limited) understanding, the ACS URL is where the request should
> end up once it completes its round-trip from the IdP, right?
Yes and no. The ACS URL is where the IDP sends the response with the
SAML protocol message to, with help from your web browser. I.e., it's
where your SimpleSAMLphp instance recieves and processes the SAML, and
where SimpleSAMLphp then decides to redirect you further.
The originally requested (protected) resource, where you ultimately
want to end up again is the 'RelayState', which the SP sets before all
the madness starts, which gets sent to the IDP and which the IDP must
return back to the SP verbatim, so the SP can then send you off to
your resource after all. So that's different from the ACS URL, as it's
your application/code/resource the subject wants to access.
And the entityID is a different URI again, it's a globally unique name
for your SAML entity.
You'd have to ask the IDP admin what kind of information the required
value for 'PartnerSpId' should be.
> So at this
> point I'm kind of stuck. I can't see what data their service is returning
> to me, because it's redirecting back to the wrong page.
You can, using browser plugins (or a logging proxy).
> A secondary question is, ultimately that return URL needs to be
> dynamic and I can't just change the metadata every time a new
> request is sent out, so how do I ensure someone who goes to
> /admin/page3.php directly gets returned to /admin/page3.php rather
> than some arbitrary URL?
No, only the entityID (the name of your SP) and the ACS URL (the
location where SimpleSAMLphp wants to recieve SAML protocol messages)
are in metadata, not the URLs of protected resources, which can be as
dynamic as you want them to be.
> I've used Chrome developer tools to see what requests are made, and
> I'm including the RelayState with my request, which should bring me
> back to the right page.
It should, if everything were correct.
> So my questions are: how do I control what page their service posts
> back to? And can that be dynamic or does it always have to go to a
> single page, at which point my app would need to manually redirect
> back to the actual page requested?
You don't need to control where they send the response to because
that's none of your concern, really, SimpleSAMLphp handles the
processing of SAML protocol messages on your behalf. What you (or your
SP) control is what happens /after/ SimpleSAMLphp has recieved the
SAML on its endpoint, has created a session with extracted attributes
and passes control back to your own code.
The ACS URL can (and usually should) be static.
The redirect to the originally requested URL should happen
automagically based on the RelayState value, and would be done by
SimpleSAMLphp.
-peter