title: Simplesamlphp - stuck in the simplesamlphp page when integrating with my application
body: <p>So, I am trying to integrate my application with SimpleSAMLphp.</p>
  
  <p>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")</p>
  
  <p>But when I try to integrate with my application, after loggin in with an IdP, I get stuck in the simplesamlphp page</p>
  
  <p>Like this:</p>
  
  <ol>
  <li><p>I open my application</p></li>
  <li><p>My Application calls requireAuth, which redirects me to the simplesamlphp page, where I can choose which IdP I am going to use</p></li>
  <li><p>I choose one IdP. I get redirected to the IdP page. I successfully log in.</p></li>
  <li><p>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.</p></li>
  </ol>
  
  <p>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.</p>
  
  <p>Here is my application code</p>
  
  <pre><code>&lt;?php
  require_once ('/var/simplesamlphp/lib/_autoload.php');
  
  $as = new SimpleSAML_Auth_Simple ( 'default-sp' );
  
  if ($as-&gt;isAuthenticated ()) {
    die ( 'ok' );
  } else {
    $param = array (
      'ReturnTo' =&gt; 'http://teste.localhost' 
    );
    $as-&gt;requireAuth ( $param );
  }
  
  $attributes = $as-&gt;getAttributes ();
  print_r ( $attributes );
  </code></pre>