5

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:

  1. I open my application

  2. My Application calls requireAuth, which redirects me to the simplesamlphp page, where I can choose which IdP I am going to use

  3. I choose one IdP. I get redirected to the IdP page. I successfully log in.

  4. 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 );
4

1 に答える 1