asasmoyo / yii-simplesamlphp

8 stars 5 forks source link

State information lost #2

Open mnkq opened 9 years ago

mnkq commented 9 years ago

hi asasmoyo, i tried to use simplesaml in my yii aplication..

i already follow your instruction.. but i found this error..

SimpleSAML_Error_NoState: NOSTATE Backtrace: 2 C:\xampp\htdocs\wwwtest\simplesamlphp\lib\SimpleSAML\Auth\State.php:232 (SimpleSAML_Auth_State::loadState) 1 C:\xampp\htdocs\wwwtest\simplesamlphp\modules\saml\www\sp\saml2-acs.php:54 (require) 0 C:\xampp\htdocs\wwwtest\simplesamlphp\www\module.php:135 (N/A)

this is my main.php in config..

... 'components'=>array(

    'simplesamlphp' => array( 
        'class' => 'ext.yii-simplesamlphp.components.Simplesamlphp',
        'autoloadPath' => '../simplesamlphp/lib/_autoload.php',
        'authSource' => 'default-sp',
    ),  

    'user'=>array(
        // enable cookie-based authentication
        'allowAutoLogin'=>true,
        'class' => 'ext.yii-simplesamlphp.components.SSOWebUser',
    ),

and this is my sitecontroller.php..

... public function actions() { return array( // captcha action renders the CAPTCHA image displayed on the contact page 'captcha'=>array( 'class'=>'CCaptchaAction', 'backColor'=>0xFFFFFF, ), // page action renders "static" pages stored under 'protected/views/site/pages' // They can be accessed via: index.php?r=site/page&view=FileName 'page'=>array( 'class'=>'CViewAction', ),

        'login' => array(
            'class' => 'ext.yii-simplesamlphp.actions.LoginAction',
            'simplesamlphpComponentName' => 'simplesamlphp',
            'redirectAfterLoginTo' => array('/index.php/pegawai'),
        ),
        'logout' => array(
            'class' => 'ext.yii-simplesamlphp.actions.LogoutAction',
            'simplesamlphpComponentName' => 'simplesamlphp',
            'redirectAfterLogoutTo' => array('/logoutex.php'),
        ),          

    );
}

/**
 * This is the default 'index' action that is invoked
 * when an action is not explicitly requested by users.
 */
public function actionIndex()
{
    if (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')){
        $this->render('logi') ;}
    else {

         if (Yii::app()->user->isGuest) {
            Yii::app()->simplesamlphp->login();
        } else {
            $this->redirect(Yii::app()->request->baseUrl.'/index.php/pegawai'); 
        }
    }
}

can you help me please..

asasmoyo commented 9 years ago

I think there is problem with your simplesamlphp's session storage, and i thik it is very similar like #1. Do you change your simplesamlphp's session storage? Can you try use database for your session storage?