Skip to main content

WebSSO configuration for PHPBB

The following attributes must be added to apache configuration

<Location />
        ShibRequestSetting applicationId forum
        ShibRequireSession off
        AuthType shibboleth
        Require shibboleth
</Location>
<Location /ucp.php>
        ShibRequireSession on
        ShibRequestSetting requireSession true
        AuthType shibboleth
        Require valid-user
</Location>
SoffidOnLoadScript 'index.php$' .* 20000 /etc/apache2/soffid/forum-front.js
SoffidOnLoadScript '/ucp.php$' .* 20000 /etc/apache2/soffid/forum-ucp.js
SoffidOnLoadScript '/posting.php$' .* 20000 /etc/apache2/soffid/forum-posting.js
SoffidPostData '/ucp.php\?mode=login' system=ldap account=username password=password

Now, the following scripts must be added:

forum-front.js
// Script to remove user & password from front page
//
debug ("***********************************************************************");
account = secretStore.getAccount("ldap");
debug ("Account = "+account);
debug ("***********************************************************************");
user = document.getElementById("username");
if (user != undefined)
{
        fieldset = user.parentNode;
        children = fieldset.childNodes;
        for (i = 0; i <  6; i++)
        {
                children.item(i).setAttribute("style", "display:none");
        }
        if (account != undefined)
        {
                user.setAttribute("value", account);
                user.setAttribute("readonly", true);
                user.setAttribute("style", "");
        }
        fieldset.setAttribute("style", "display:none");
}
// Change login button
anchors = document.getElementsByTagName("a");
for (i = 0 ; i < anchors.length; i++)
{
      if (/.*\/ucp.php\?mode=login.*/.test(anchors.item(i).getAttribute("href")))
      {
        anchors.item(i).setText("Login / Register");
      }
}