simplesamlphp IDP Initiated authentication using existing session

2.1k views Asked by At

I have a Zend project where users login through a login page backed by a database. I have implemented IdP initiated SSO functionality using simplesamlphp.

Current flow of the events is :-

  1. User login into my website.
  2. Clicks on the IDP initiated SSO link.
  3. User is redirected to the login page I created for SSO login handling. ( Ideally it should happen if user is not logged in. )
  4. After login user is sent to the required IDP.
  5. After printing $_SESSION here and there I found that this is happening because proper session variables for simplesamlphp is not set.

What I want simplesaml to do is following :-

  1. User login into to my website.
  2. User click on IdP initiated SSO link.
  3. User is redirected to the service provider.

But I am unable to find any method to do so. Please help.

1

There are 1 answers

1
techgyani On BEST ANSWER

To solve this, I initiated the simplesaml session before making user login using

 SimpleSAML_Session::getInstance(); 
//This method makes the $_SESSION empty and stores the required session parameters it wants.

After this I stored the user's login credentials on the session. I don't know if this is the best way to solve this.