So, I am trying to integrate my application with SimpleSAMLphp.
I have to IdP configured and they're both working fine (I can test it on the simplesamlphp admin page, via "Test configured authentication sources")
But when I try to integrate with my application, after loggin in with an IdP, I get stuck in the simplesamlphp page
Like this:
I open my application
My Application calls requireAuth, which redirects me to the simplesamlphp page, where I can choose which IdP I am going to use
I choose one IdP. I get redirected to the IdP page. I successfully log in.
The IdP redirects me back to the simplesamlphp IdP selection screen. I get stuck in here because when I open My Application, it redirects me to this same page.
Does someone knows what am I doing wrong? I think it is a configuration problem, but I have no idea which one could be. Also, isAuthenticated function ALWAYS returns false.
Here is my application code
<?php
require_once ('/var/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple ( 'default-sp' );
if ($as->isAuthenticated ()) {
die ( 'ok' );
} else {
$param = array (
'ReturnTo' => 'http://teste.localhost'
);
$as->requireAuth ( $param );
}
$attributes = $as->getAttributes ();
print_r ( $attributes );