Simplesamlphp costuming the time of redirect

56 views Asked by At

While using SimpleSAMLphp as SP we use:

require_once('/var/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('xxx');
$as->requireAuth();

However the user is redirected to the current page or a specified page just after the method requireAuth(). If I want to add some other procedures before the redirection, for example create a session, what shoud I do? Is there a method to costuming the time of redirect after a success authentification?

Thanks for help,

1

There are 1 answers

0
Leo On

simplesamlphp only manages the authentication. The rest of your system can create sessions and other procedures on the page you are redirected on. If you want to retrieve some information from the database that you use for authentication, do:

$attributes = $as->getAttributes();
var_dump($attributes);

after the requireAuth(); call.

The way I have it configured is to have all the authentication calls in an include at the top of every page I want password protected, and below that, the rest of the PHP funcntions.