2018-03-10 04:34
浏览 172


I am using SSOCircle to test out my SAML implementation with Codeigniter. The current steps are:

  1. Access
  2. Redirected to SSOCircle Consent Page
  3. Verify identity
  4. Pass user data back to

However, after step 3, it goes to step 4 and back to step 3 immediately.

This is my code:

public function index()
        $data['languages']= get_all_languages();
        $sp_auth = 'default-sp';
        try {
            $auth = new SimpleSAML_Auth_Simple($sp_auth);
            'ReturnTo' => $this->data['controller'],
            'KeepPost' => FALSE,
            $attributes = $auth->getAttributes();
        } catch (Error $e) {

I have considered that my redirect may be the reason it keeps calling the consent page. However when added another url for it to access with this function

public function auth(){
        $attributes = $auth->getAttributes();

I get this error:


1 www/_include.php:45 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: SimpleSAML_Error_Exception: No authentication source with id 'Login/Auth' found.
2 lib/SimpleSAML/Auth/Source.php:335 (SimpleSAML_Auth_Source::getById)
1 modules/saml/www/sp/saml2-acs.php:12 (require)
0 www/module.php:135 (N/A)

I'm hoping someone can take a look at this and help me with it. Thank you.


I recently noticed that SSOCircle actually returns back to my login page. However, it immediately redirects it back to the SSOCircle page. Not sure if this helps

NULL Redirect You were redirected to:

UPDATE2 : I just checked the logs and I have received this warning

Mar 12 23:26:26 simplesamlphp WARNING [da20d4a7a3] Could not load state specified by InResponseTo: NOSTATE Processing response as unsolicited.

I was told that this is because of lost state information. However I have checked my cookie names and they match up. What else have I missed?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • doufud21086 2018-03-18 14:11

    Update: The subsequent paragraph assume that when you modified your code to avoid the cyclique redirection you've made sure to :

    Configure the authentication module :**

    On unix, this can be done by running (from the SimpleSAMLphp installation directory):

    touch modules/exampleauth/enable

    The next step is to create an authentication source with this module. An authentication source is an authentication module with a specific configuration. Each authentication source has a name, which is used to refer to this specific configuration in the IdP configuration. Configuration for authentication sources can be found in config/authsources.php.

    In this setup, this file should contain a single entry:

    $config = array(
        'example-userpass' => array(
            'student:studentpass' => array(
                'uid' => array('student'),
                'eduPersonAffiliation' => array('member', 'student'),
            'employee:employeepass' => array(
                'uid' => array('employee'),
                'eduPersonAffiliation' => array('member', 'employee'),

    This configuration creates two users - student and employee, with the passwords studentpass and employeepass. The username and password is stored in the array index (student:studentpass for the student-user. The attributes for each user is configured in the array referenced by the index. For the student user, these are:

        'uid' => array('student'),
        'eduPersonAffiliation' => array('member', 'student'),

    The attributes will be returned by the IdP when the user logs on.

    Mismatch between PHP session settings for the application and SimpleSAMLphp

    If both the application you are trying to add SAML 2.0 support to and SimpleSAMLphp uses PHP session for session storage, and they don't agree on all the parameters, you can end up with this error. By default, SimpleSAMLphp uses the settings from php.ini, but these can be overridden in config/config.php.

    If this is the cause of your error, you have two choices:

    Then No authentication source with id error occurred because of a conflict of handling the session between simpleSAMLphp and codeIgniter.

    Solution 1 : change SimpleSAMLphp to use a different session storage method

    The solution is to set simpleSAMLphp to use something other than phpsession, as there is an issue with Memcached the best way is to set it to 'sql'. You do that in simplesamlphp/config/config.php:

     * Configure the datastore for simpleSAMLphp.
     * - 'phpsession': Limited datastore, which uses the PHP session.
     * - 'memcache': Key-value datastore, based on memcache.
     * - 'sql': SQL datastore, using PDO.
     * The default datastore is 'phpsession'.
     * (This option replaces the old 'session.handler'-option.)
    'store.type'                    => 'sql',

    Solution 2 : Change the session settings to match between the application and SimpleSAMLphp:

    If you decide to make the session settings match, you should change the settings in php.ini. This is to make sure that the settings apply to everything that uses the default settings. The following options in php.ini must match the settings used by the application:

    • session.save_handler: This is the method that is used to store the session. The default is "files".
    • session.save_path: This is the location the session files are saved. The default depends on your PHP installation.
    • This is the name of the session cookie. The default is "PHPSESSID".
    • session.cookie_path: The path that the session cookie is limited to. The default is "/", which means that it is available to all pages on your domain.
    • session.cookie_domain: This is the domain the session cookie is limited to. The default is unset, which makes the cookie available
      only to the current domain.

    Please look at the docs for more information

    If that still didn't work, as the last resort : try disabling varnish caching


    打赏 评论

相关推荐 更多相似问题