On Thu, Oct 11, 2012 at 09:09:55 -0700, Maik wrote:
> Hi,
>
> I'm having troubles with the authentication in the Yii side when calling
> simplesaml.
>
> I have implemented SimpleSaml in Yii like this
>
> //Set location of simplesamlphp
> > $simplesaml = '../vendors/SimpleSamlPhp';
> > Yii::setPathOfAlias('simplesamlphp', $simplesaml);
> > Yii::setPathOfAlias('simplesaml', $simplesaml);
> >
> > // temporary disable Yii autoloader
> > spl_autoload_unregister(array('YiiBase','autoload'));
> >
> > // create 3rd-party object
> > require_once($simplesaml . '/lib/_autoload.php');
> > // enable Yii autoloader
> > spl_autoload_register(array('YiiBase','autoload'));
> >
>
> Session for simplesaml is set:
>
> > SimpleSAMLSessionID=64992b82842384688a5871fd66381c02; path=/;
> > domain=
forum.insided.com; HttpOnly
>
>
> Session for yii is set:
>
> PHPSESSID=20b8db421c9f5e0f701fc3d09954c8d0; path=/;
> > domain=
forum.insided.com
> >
>
> My saml login is situated at /sso/saml
>
> $asId = Yii::app()->params['sso']['saml']['asId'];
> > $as = new SimpleSAML_Auth_Simple($asId);
> >
> > if (!$as->isAuthenticated()) {
> > $params = array(
> > 'ErrorURL' => "/error/errorrr",
> > 'ReturnTo' => Yii::app()->yipRequest->currentURL(),
> > );
> > $as->requireAuth($params);
> > } else {
> > echo "loggedin";
> > }
> >
>
> But when i'm calling this, everything in the flow is ok, except for
> $as->isAuthenticated(). It remains false (so I'm stuck in an infinite
> redirect loop).
>
> Anybody who knows how I could conform the simplesaml session with the yii
> session?
>
> By the way, the yii session is a CDbHttpSession, so it's stored in my mysql
> db.
And what session handler are you using for simpleSAMLphp?
If simpleSAMLphp is using a different session handler than the PHP
session handler, you should not get a conflict between Yii and
simpleSAMLphp.
Have you made sure that the response from the IdP is returned to the
same domain as you start authentication from?
Best regards,
Olav Morken
UNINETT / Feide