zl4bv / CakePHP-simpleSAMLphp-Plugin

Adds support for SAML authentication to CakePHP 2.x.
12 stars 8 forks source link

How to configure the CakePHP site as a SP ? #4

Closed saulojg closed 9 years ago

saulojg commented 10 years ago

Could you please provide an example showing how to add the CakePHP site as a SP on the simpleSAMLphp configuration? I'm struggling with the SingleSignOnService and SingleLogoutService URLs

I configured a SimpleSamlPHP working as a IDP On the CakePHP site (the SP) I'm using both SimpleSamlPHP and Auth->FormAuthenticate

Thanks in advance

zl4bv commented 10 years ago

For the logout URL, you could create an action in your cake controller to call the logout function:

public function logout() { return $this->redirect($this->Auth->logout()); }

Assuming you're using the SamlFormAuthenticate, this will invoke simpleSAMLphp's logout mechanism for you. If simpleSAMLphp is configured with a logout redirect URL then the user will be redirected to this URL prior to being logged out.

As for the sign on URL, I will need to dig into simpleSAMLphp's code a bit more to answer this for you.