Example code:
We start off with loading a file which registers the SimpleSAMLphp classes with the autoloader.
require_once('../../lib/_autoload.php');
We select our authentication source:
$as = new SimpleSAML_Auth_Simple('default-sp');
We then require authentication:
$as->requireAuth();
And print the attributes:
$attributes = $as->getAttributes();
print_r($attributes);
Each attribute name can be used as an index into $attributes to obtain the value. Every attribute value is an array - a single-valued attribute is an array of a single element.
We can also request authentication with a specific IdP:
$as->login(array(
'saml:idp' => 'https://idp.example.org/',
));
Other options are also available. Take a look in the documentation for the SP module for a list of all parameters.
If we are using PHP sessions in SimpleSAMLphp and in the application we are protecting, SimpleSAMLphp will close any existing session when invoked for the first time, and its own session will prevail afterwards. If you want to restore your own session after calling SimpleSAMLphp, you can do so by cleaning up the session like this...
However, my SimpleSAMLphp IdP is on another system. Here is what I'm trying to accomplish:
1.) Centralizing several PHP-based network monitoring applications into one system
2.) Using SimpleSAMLphp as an IdP. Eventually, I want to use the login on SimpleSAMLphp as a "centralized portal" where you login and start an IdP initiated SSO. The SSO will be for the network monitoring applications.
Is there an example of using SimpleSAMLphp as an IdP for PHP applications (on other systems)? Do you have to install SimpleSAMLphp on the SP's too? I can provide metadata information if it is requested. I'm still very new to the concept of SAML. If I am asking for something SimpleSAMLphp cannot do, I apologize. Again, I also apologize if I'm asking stupid questions. Any help is much appreciated! Thanks.