• This plugin works fine on all our sites. We use simple SAML php as IdP.
    Installation is quite simple and we’ve seen no errors up to this point.

    Didn’t test it with multisite.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi DRazumovskiy, would you share with me how you configured the Service Provider part? According to the docs that section is “To be continued…” ?? Not really sure where to turn to, I am also using Simplesamlphp but a little confused as to what to put for Groups as we don’t currently return that from the IdP. Would appreciate any help you can offer me. Thanks

    Thread Starter DRazumovskiy

    (@drazumovskiy)

    Hi bizt!

    You touched an interesting topic. Indeed we had to slightly modify the code of the plugin. We designed a dedicated field WPMember in our IdP. This field stores a user’s group name. We also use Members plugin which allows creation of custom groups with dedicated permissions.

    In wp-content/plugins/saml-20-single-sign-on/lib/classes/saml_client.php we modified a function update_role like that:

    private function update_role()
      {
    /*    $attrs = $this->saml->getAttributes();
        if(array_key_exists($this->settings->get_attribute('groups'), $attrs) )
        {
          if( in_array($this->settings->get_group('admin'),$attrs[$this->settings->get_attribute('groups')]) )
          {
            $role = 'administrator';
          }
          elseif( in_array($this->settings->get_group('editor'),$attrs[$this->settings->get_attribute('groups')]) )
          {
            $role = 'editor';
          }
          elseif( in_array($this->settings->get_group('author'),$attrs[$this->settings->get_attribute('groups')]) )
          {
            $role = 'author';
          }
          elseif( in_array($this->settings->get_group('contributor'),$attrs[$this->settings->get_attribute('groups')]) )
          {
            $role = 'contributor';
          }
          elseif( in_array($this->settings->get_group('subscriber'),$attrs[$this->settings->get_attribute('groups')]) )
          {
            $role = 'subscriber';
          }
          elseif( $this->settings->get_allow_unlisted_users() )
          {
            $role = 'subscriber';
          }
          else
          {
            $role = false;
          }
        }
        else
        {
          $role = false;
        }
    */
        $attrs = $this->saml->getAttributes();
        $role = $attrs[$this->settings->get_attribute('groups')][0];
    
        $user = get_user_by('login',$attrs[$this->settings->get_attribute('username')][0]);
        if($user)
        {
          $user->set_role($role);
        }
    
        return $role;
      }

    In plugin config page we set WPMember as the field to use for a determination of the group. The rest of the settings page (Groups) is not used in our case.

    Hope this helps.

    Please could I send you an email with the issue I encountered using this plug-in?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Works fine’ is closed to new replies.