Hi Gavin,
On 24 Feb 2014, at 21:03 pm, Gavin P <
ga...@gavinpearce.com> wrote:
> Hi all,
>
> Thanks for your help here - so I've gone ahead and set the baseurlpath and given this a go, however am seeing the following error:
> "State information lost, and no way to restart the request
> SimpleSAML_Error_NoState: NOSTATE"
>
> This makes sense to me, as we end up on a different domain from where we started and so it can't load the session cookies.
>
> As I'm obviously missing something, this is the 'flow' so to speak:
>
> baseurlpath => '
https://our-sp.com/simplesaml/'
>
> 1) User visits a protected area:
http://application1.com/private
> This area loads the simplesaml classes: require_once('../simplesamlphp/lib/_autoload.php');
> and is protected with: $as->requireAuth(array()); //Array containts a ReturnTo item of:
http://application1.com/private
>
> 2) POST request is issued to the IdP (the IdP needs us to use HTTP-Post bindings), however we're still on the
http://application1.com/private URL at this point.
>
> 3) The IdP process is run (register/login etc), and we get returned back to the SP our end, (before the RelayState/ReturnURL magic happens)
> User is now at:
http://our-sp.com/simplesaml/module.php/saml/sp/saml2-acs.php/our-sp-name
>
> And obviously, as the domain is different from that at the start, we get the State error as it can't load the session info.
I’m guessing that you say “different”, because the URL where the SAML assertion is posted belongs to the SP, not to the application (
application1.com). That shouldn’t be a problem. The SP and the application don’t necessarily have to be in the same domain (as long as you control both domains and both are virtual hosts in the same machine, where you can use SSP’s API, of course).
In this example, your SP should be issuing a SAML request according to its configuration (which refers to
our-sp.com as set in your 'baseurlpath’), configure the session on that domain, and get back a SAML response in the same domain, where it should be able to load the session correctly, mark the user as authenticated, and then return to the original URL where authentication started (by calling requireAuth()). I don’t see any reason why that shouldn’t work.
> I'm guessing at the start, the user needs to be on the
https://our-sp.com/ domain, before we issue the POST SAMLRequest to the IdP, but I'm not sure the best way to achieve this?
No, not really, as I already said. My advice is to take a look at the logs (both SSP’s and web server’s) and try to trace the error properly. You can increment the amount of messages you get in the log by setting the log level in the configuration. I would also recommend you to take a look into the actual SAML exchange, and verify that everything is fine (both the SAML documents involved and the rest of the parameters part of the WebSSO profile). There you might spot if something is wrong in the configuration. You can do that by installing the SAML tracer extension in firefox, for instance.
> Many thanks once again!
You are welcome!