Why use SAML at all, when there is only your single IdP and your SPs?
Because you need the IdP to not share a domain with the SPs?
Or are you planning to accept logins from other IdPs at some point (as
opposed to forcing Yet Another Account for your IdP upon users)?
-peter
It is possible, but maybe not in the current stable version of
simpleSAMLphp. The reason is that we need to set a cookie for the
.example.com-domain, and the required options were added after version
1.6 was released.
In the current developement version (which at some point will become
version 1.7), you can do something like the following in config.php:
/* The cookie must be valid for all subdomains of example.com. */
'session.cookie.domain' => '.example.com',
/* We need a common session store for all our domains. */
'store.type' => 'sql',
'store.sql.dsn' => 'mysql:host=mysql.example.com;dbname=somedb',
'store.sql.username' => 'someuser',
'store.sql.password' => 'somepassword',
You must also be careful when doing authentication. You must always
start it from the domain you have configured at the IdP. This means
that at each site, you must do something like:
$as = new SimpleSAML_Auth_Simple('default-sp');
if (!$as->isAuthenticated()) {
/* Need to log in. */
SimpleSAML_Utilities::redirect('https://www.example.com/startauth.php',
array('ReturnTo' => SimpleSAML_Utilities::selfURL())
);
}
And in startauth.php:
if (!isset($_REQUEST['ReturnTo'])) {
die('Missing ReturnTo parameter.');
}
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->login(array(
'ReturnTo' => (string)$_REQUEST['ReturnTo'],
));
(The reason for the startauth.php on the common site is that we
currently autogenerate the AssertionConsumerServiceURL we send in the
authentication request. If we don't start the authentication from
www.example.com, we will end up with an URL that points to a domain
that isn't registered at the IdP, which may cause it to be confused.)
(Also note that much of this hasn't been tested very much, so more
testing would be welcome.)
Regards,
Olav Morken
UNINETT / Feide