Table of Contents

Dokuwiki

New install 2022

references

installation de base

[root@mt wik]# wget https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
[root@mt wik]# mv dokuwiki-stable.tgz dokuwiki-stable_2020-07-29_Hogfather.tgz

[root@mt wiki]# tar xvfz  dokuwiki-stable_2020-07-29_Hogfather.tgz
[root@mt wiki]# mv dokuwiki-2020-07-29 wik
[root@mt wiki]# cd wik

permissions

afin de pouvoir lancer l'installeur il faut ouvrir des permissions pour le proprietaire du process httpd (ici apache)

[root@mt wik]# cp .htaccess.dist .htaccess
[root@mt wik]# vim .htaccess
[root@mt wik]# chown apache data
[root@mt wik]# chown apache data/tmp
[root@mt wik]# chown apache data/pages/
[root@mt wik]# chown apache data/attic/
[root@mt wik]# chown apache data/media
[root@mt wik]# chown apache data/media_attic/
[root@mt wik]# chown apache data/meta/
[root@mt wik]# chown apache data/media_meta/
[root@mt wik]# chown apache data/cache/
[root@mt wik]# chown apache data/index/
[root@mt wik]# chown apache data/locks/
[root@mt wik]# chown apache data/index/
[root@mt wik]# chown apache lib/tpl/
[root@mt wik]# chown apache conf/
[root@mt wik]# chown apache conf/local.php.dist 
[root@mt wik]# chown apache lib/plugins/

auth shibboleth

installation du plugin

[root@mt wik]# mv lib/plugins/authshibboleth lib/plugins/authshibboleth-manager-installed
[root@mt wik]# cp -a lib/plugins/authshibboleth-manager-installed/plugin/authshibboleth ./lib/plugins/

[root@mt wik]# less lib/plugins/authshibboleth-manager-installed/README.md 

petit correctif, en l'etat le plugin provoque cette erreur dans les logs

[Mon May 23 18:56:42.777627 2022] [php7:error] [pid 2295] [client 192.168.12.190:46606] PHP Fatal error:  Declaration of action_plugin_authshibboleth::register(Doku_Event_Handler &$controller) must be compatible with dokuwiki\\Extension\\ActionPlugin::register(Doku_Event_Handler $controller) in /var/www/dok/wik/lib/plugins/authshibboleth/action.php on line 0, referer: https://mt.dom.fr/wik/doku.php?id=start&do=admin&page=extension&tab=search&q=

il faut alors appliquer le patch (simple retrait d'un “&” ligne 40) :

[root@mt wik]# vim lib/plugins/authshibboleth/action.php

    //public function register(Doku_Event_Handler &$controller) # ligne 40 
    public function register(Doku_Event_Handler $controller)

CE patch semble maintenant integré suite au PR .

patch shib php8

un autre patch “maison” a été fait pour supporter php 8 afin de ressoudre cette erreur

dokuwiki\Exception\FatalException: Declaration of auth_plugin_authshibboleth::trustExternal() must be compatible with dokuwiki\Extension\AuthPlugin::trustExternal($user, $pass, $sticky = false)

il suffit d'ajouter/declarer les parametres attendus comme indiqués dans authshibboleth/auth.php

  * @see DokuWiki_Auth_Plugin::trustExternal()
     */
    //public function trustExternal()
   public function trustExternal($user, $pass, $sticky = false)

patch multi auth-chained

autre besoin, gerer le multi-authentification ⇒ local (compte local docuwiki ) et federation ID shibboleth

[root@wiki authshibboleth]# diff action.php.bak action.php
50c50,51
<         if ('login' == $ACT && !array_key_exists('auth', $_SESSION[DOKU_COOKIE])) {
---
> 	if ('login' == $ACT && !isset($_SESSION[DOKU_COOKIE]['auth']['user'])) {
> 

patch Logout

Dokuwiki redirige vers do=login, l'auth shibboleth se redéclenche immédiatement, pour contourner ce problème il faut patcher Logout.php pour retourner sur la page principal et pas sur la page de login

Action]# diff Logout.php.bak Logout.php
47c47
<         send_redirect(wl($ID, array('do' => 'login'), true, '&'));
---
>         send_redirect(wl($ID, array(), true, '&'));

custom Login page

pour customiser le bouton login de la navbar en y faisant apparaitre l'auth Shib/fédé-ID, il faut editer le fichier lib/tpl/bootstrap3/tpl/navbar.php

pour le formulaire de login, c'est dans inc/Ui/Login.php

post-upgrade 2022-07-igor

plugins

indexmenu

https://www.dokuwiki.org/plugin:indexmenu

authshib

https://github.com/ivan-novakov/dokuwiki-shibboleth-auth/archive/refs/heads/master.zip

+ astuce authshib dans action.php

//public function register(Doku_Event_Handler &$controller)
    public function register(Doku_Event_Handler $controller)

conf/local.php pour la sidebar

// jehan upgrade igor 2023-01 sidebar
$conf['defer_js'] = 0;

bootstrap 3 themes

https://doc.ubuntu-fr.org/utilisateurs/fabux/emeht

reference 2013

suite a la mise a jour en 2013-12-08 “Binky” beaucoup de changement ont eu lieux en terme d'authentification depuis le passage en 2013-05-10a “Weatherwax” et les auth plugins: https://www.dokuwiki.org/changes

Installation

Installation dans un espace web personnel (webspace/page perso)

Download & Désarchivage

2016

$ tar xvfz dokuwiki-stable-2016-06-26a-Elenor_of_Tsort.tgz

2010

[jehan@localhost ~/Download]
$ wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2009-12-25.tgz


[jehan@localhost ~/sshfs/public]
$ tar xvfz dokuwiki-2009-12-25.tgz
drwxr-xr-x andi/andi         0 2009-12-25 11:14 dokuwiki-2009-12-25/
-rw-r--r-- andi/andi      2257 2009-12-25 11:14 dokuwiki-2009-12-25/doku.php
-rw-r--r-- andi/andi      1470 2009-12-25 11:14 dokuwiki-2009-12-25/.htaccess.di
st
drwxr-xr-x andi/andi         0 2009-12-25 11:14 dokuwiki-2009-12-25/inc/
-rw-r--r-- andi/andi        68 2009-12-25 11:14 dokuwiki-2009-12-25/inc/.htacces
s
...


[jehan@localhost ~/sshfs/public]
$ ls dokuwiki-2009-12-25/
$ ls dok
bin   COPYING  doku.php  inc        install.php  README
conf  data     feed.php  index.php  lib          VERSION

Simplification du nom du repertoire racine

[jehan@localhost ~/sshfs/public]
$ mv dokuwiki-2009-12-25 dokuwiki

Configuration

cf http://www.dokuwiki.org/config

2016 : https://www.dokuwiki.org/install:permissions

Permissions

Pendant la phase de paramétrage/installation il est souhaitable de fermer l'acces au wiki afin que personne vienne perturber cette fraiche installation qui par défaut est ouverte à tout le monde .

[jehan@localhost ~/sshfs/public/dokuwiki]
$ cp .htaccess.dist .htaccess

[jehan@localhost ~/sshfs/public/dokuwiki]
$ cat .htaccess
<Limit GET POST>
Deny from all
Allow from 157.159.55.155
</Limit>

Installer web interface

http://www-public.it-sudparis.eu/~procacci/dokuwiki/install.php

Premiere alerte:

The installer found some problems, indicated below. You can not continue until you have fixed them.

    * /mci/mci/procacci/public/dokuwiki/conf/ is not writable by DokuWiki. You need to fix the permission settings of this directory!
    * /mci/mci/procacci/public/dokuwiki/data is not writable by DokuWiki. You need to fix the permission settings of this directory!
etc ...

Il faut donner les droits a compte (apache = 48 ) exécutant le serveur httpd sur ces directories Hélas pour ce faire il faut etre root ! (trouver mieux …)

[root@cobra /disk20/public/mci/procacci/public/dokuwiki]
$ chown -R 48 data/
$ chown  48 lib/plugins/
$ chown  48 conf/

ensuite cela se passe bien, on tombe sur l'interface web de parametrage initial.

<img src=“%ATTACHURLPATH%/dokuwiki-installer-admin.png” alt=“dokuwiki-installer-admin.png” width='711' height='552' />

ce qui se retrouve dans :

[jehan@localhost ~/sshfs/public/dokuwiki/conf]
$ cat local.php
<?php
/**
 * Dokuwiki's Main Configuration File - Local Settings
 * Auto-generated by install script
 * Date: Sun, 03 Jan 2010 12:00:44 +0100
 */
$conf['title'] = 'Jehan\'s wiki';
$conf['lang'] = 'en';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';

Configuration

Paramétrage du login

Forcer un login en https

cf http://www.dokuwiki.org/security

Mettre en place des RewriteRules dans le *.htaccess*:

[jehan@localhost ~/sshfs/public/dokuwiki]
$ cat .htaccess
RewriteEngine on
RewriteBase /dokuwiki
RewriteCond %{HTTPS} !on
RewriteCond %{QUERY_STRING} do=log
RewriteRule ^(.*) https://%{HTTP_HOST}/~procacci/dokuwiki/$1 [R,QSA,L]
#remove https after login page
RewriteCond %{HTTPS} on
RewriteCond %{QUERY_STRING} !do=log
RewriteCond %{REQUEST_METHOD} GET
RewriteRule ^(.*) http://%{HTTP_HOST}/~procacci/dokuwiki/$1 [R,QSA,L]

Template rendering

http://www.dokuwiki.org/template

monobook

http://www.dokuwiki.org/fr:template:monobook

[procacci@arvouin ~/sshfs/public/dokuwiki/lib/tpl]
$ wget http://tjgrant.com/wiki/_media/software:dokuwiki:monobook-2008-07-30.tar.bz2?id=software%3Adokuwiki%3Atemplate%3Amonobook&cache=cache

[procacci@arvouin ~/sshfs/public/dokuwiki/lib/tpl]
$ tar xvf monobook-2008-07-30.tar

[procacci@arvouin ~/sshfs/public/dokuwiki/conf]
$ tail -1 local.php
//$conf['template'] = 'monobook';

Template artic rendering

http://www.dokuwiki.org/template:arctic

installation par git

[root@localhost tpl]# git clone https://github.com/samfisch/dokuwiki-template-arctic.git arctic
Cloning into 'arctic'...
remote: Counting objects: 1363, done.
remote: Total 1363 (delta 0), reused 0 (delta 0), pack-reused 1363
Receiving objects: 100% (1363/1363), 314.27 KiB | 422.00 KiB/s, done.
Resolving deltas: 100% (683/683), done.
[root@localhost tpl]# ls
arctic  dokuwiki  index.php

user ou group sidebar

http://www.dokuwiki.org/template:arctic#adding_a_user_sidebar

Exemple

[jehan@calaz ~/sshfs/public/dokuwiki/data/pages/group/mci]
$ cat sidebar.txt 
====== @GROUP@  ======
[[wiki:playground]]\\
[[wiki:syntax]]\\

IndexMenu

usage d'un index dynamique dans la sidebar

indexmenu plus a jour que indexmenu2 ! ref http://samuele.netsons.org/dokuwiki/doku.php

[root@wikis plugins]# wget https://github.com/samuelet/indexmenu/archive/master.zip
[root@wikis plugins]# unzip master.zip 
[root@wikis plugins]# mv indexmenu-master/ indexmenu

table of content (toc) dans la sidebar

[root@wikis conf]# grep tpl local.php
$conf['tpl']['arctic']['left_sidebar_content'] = 'main,toc,user,group,namespace';

HTML-wiki-converter

installation

# perl -MCPAN -e 'install HTML::WikiConverter'
# perl -MCPAN -e 'install HTML::WikiConverter::DokuWiki'

usage

html2wiki --dialect=DokuWiki /home/jehan/Download/ShibdemoWayf.html > ShibdemoWayf.wiki

Upgrade

http://www.dokuwiki.org/install:upgrade

backup

Avant tout, backup de l'ancienne version

$ cp -a dokuwiki dokuwiki-2008-05

download

[procacci@arvouin ~/sshfs/public]
$ wget http://www.splitbrain.org/_media/projects/dokuwiki/dokuwiki-2009-02-14b.tgz
[procacci@arvouin ~/sshfs/public]
$ tar xvfz dokuwiki-2009-02-14b.tgz

upgrade

Recopie de la nouvelle version par dessus l'anciene

[procacci@arvouin ~/sshfs/public]
$ cp -rf dokuwiki-2009-02-14/* dokuwiki/

Fichier de configuration

a priori les config ne sont pas detruite si tout s'est fait dans local.php, mais ici avec CAS par exemple on a touché a conf/dokuwiki.php et doku.php!

above steps are safe when you always adhered to the advice to only change local versions of your config files(like conf/local.php instead of conf/dokuwiki.php) User data and ACL information are never overwritten because DokuWiki only ships examples (with a .dist extension).

doku.php

[procacci@arvouin ~/sshfs/public/dokuwiki]
$ diff doku.php ../dokuwiki-2008-05/doku.php
...
> // casification from http://www.esup-portail.org/display/PROJDOCUWIKICAS/CASification+de+Docuwiki
>
> if ($ACT == 'login') {
>     phpCAS::setFixedServiceURL(
...

fichier a retirer

Retrait manuel de certain fichiers

[procacci@arvouin ~/sshfs/public]
$ cat dokurem.sh
#!/bin/bash

for f in `cat dokuwiki-removedFiles`
do

if [ -f $f ] ; then
        ls -l $f
        rm  $f
fi

[procacci@arvouin ~/sshfs/public]
$ bash dokurem.sh
-rw-r--r-- 1 procacci mci 6791 mai  5  2008 dokuwiki/inc/auth/punbb.class.php
-rw-r--r-- 1 procacci mci 291 mai  5  2008 dokuwiki/inc/lang/ko/edit.txt_bak
-rw-r--r-- 1 procacci mci 4409 mai  5  2008 dokuwiki/inc/lang/ko/lang.php_bak
-rw-r--r-- 1 procacci mci 532 mai  5  2008 dokuwiki/inc/lang/ku/admin_acl.txt
-rw-r--r-- 1 procacci mci 577 mai  5  2008 dokuwiki/inc/lang/mg/admin_acl.txt
-rw-r--r-- 1 procacci mci 7743 mai  5  2008 dokuwiki/lib/plugins/importoldchangelog/action.php
-rw-r--r-- 1 procacci mci 2100 mai  5  2008 dokuwiki/lib/plugins/importoldindex/action.php
-rw-r--r-- 1 procacci mci 431 mai  5  2008 dokuwiki/lib/plugins/usermanager/images/no_user_edit.png
-rw-r--r-- 1 procacci mci 1058 mai  5  2008 dokuwiki/lib/plugins/usermanager/images/user_edit.png
-rw-r--r-- 1 procacci mci 574 mai  5  2008 dokuwiki/lib/tpl/default/UWEB.css

Paramétrage avancé

casification

php-cas

dependance sur php-cas

$ yum install php-pear
$ yum install php-xml.i386
$ pear install http://www.ja-sig.org/downloads/cas-clients/php/1.0.2RC1/CAS-1.0.2RC1.tgz
downloading CAS-1.0.2RC1.tgz ...
Starting to download CAS-1.0.2RC1.tgz (236,284 bytes)
.................................................done: 236,284 bytes
install ok: channel://__uri/CAS-1.0.2RC1
upgrade phpCAS
$ pear upgrade  http://downloads.jasig.org/cas-clients/php/current.tgz
downloading current.tgz ...
Starting to download current.tgz (95,030 bytes)
.....................done: 95,030 bytes
upgrade ok: channel://__uri/CAS-1.3.3

yum install phpCAS

# yum install php-pear-CAS
Installed:
  php-pear-CAS.noarch 0:1.3.3-1.el7                                                                                                                                   

Dependency Installed:
  php-pear.noarch 1:1.9.4-21.el7                                                 php-process.x86_64 0:5.4.16-36.el7_1        

authplaincas 2015

https://www.dokuwiki.org/plugin:authplaincas

$ scp esn-org-authplaincas-96bd8c7.zip root@wikiserver.tem-tsp.eu:/var/www/wikis/wikidoc/lib/plugins

[root@wikidoc authplaincas]# pwd
/var/www/wikis/wikidoc/lib/plugins/authplaincas
[root@wikidoc authplaincas]# ls   
README.md  action.php  auth.php  conf  lang  license  manager.dat  plaincas.settings.php  plugin.info.txt

[root@wikis authplaincas]# cp plaincas.settings.php ../../../conf/

ancienne methode

cf http://www.esup-portail.org/display/PROJDOCUWIKICAS/CASification+de+Docuwiki

[procacci@arvouin ~/sshfs/public/dokuwiki/conf]
$ tail -8 dokuwiki.php

$conf['authtype']    = 'cas';

/* Ldap Options */
$conf['auth']['ldap']['server']      = 'ldap://ldap3.int-evry.Fr';
$conf['auth']['ldap']['usertree']    = 'ou=people,dc=int-evry,dc=fr';
$conf['auth']['ldap']['userfilter']  = '(uid=%{user})';
[procacci@arvouin ~/sshfs/public/dokuwiki]
$ tail -10 doku.php
if ($ACT == 'login') {
    phpCAS::setFixedServiceURL(
      'http://www-public.it-sudparis.eu/~procacci/dokuwiki/doku.php?'.$_SERVER["QUERY_STRING"]);
    phpCAS::forceAuthentication();
  }

  if($ACT == 'logout') {
    phpCAS::logout();
  }
?>

Fichier cas.class.php

[procacci@arvouin ~/sshfs/public/dokuwiki/inc/auth]
$ cat cas.class.php 
<?
require_once(DOKU_INC.'inc/auth/ldap.class.php');
include_once('CAS/CAS.php');

phpCAS::client(CAS_VERSION_2_0, 'cas.it-sudparis.eu', 443, 'cas');

class auth_cas extends auth_ldap {
    function auth_cas() {
        global $conf;
        $this->cando['external'] = true;
        $this->auth_ldap();
    }

    function trustExternal($user,$pass,$sticky=false){
        global $USERINFO;
        global $conf;
        $sticky ? $sticky = true : $sticky = false; //sanity check

        $session = $_SESSION[$conf['title']]['auth'];

        if(phpCAS::isAuthenticated()) {
            $user = phpCAS::getUser();

            if(isset($session)) {
                $_SERVER['REMOTE_USER'] = $user;
                $USERINFO = $session['info'];
                $_SESSION[$conf['title']]['auth']['user'] = $user;
                $_SESSION[$conf['title']]['auth']['pass'] = $session['pass'];
                $_SESSION[$conf['title']]['auth']['info'] = $USERINFO;
                $_SESSION[$conf['title']]['auth']['buid'] = $session['buid'];
            }
            else {
                $USERINFO = $this->getUserData($user);
                $_SERVER['REMOTE_USER'] = $user;
                $_SESSION[$conf['title']]['auth']['user'] = $user;
                $_SESSION[$conf['title']]['auth']['pass'] = $pass;
                $_SESSION[$conf['title']]['auth']['info'] = $USERINFO;
                $_SESSION[$conf['title']]['auth']['buid'] = auth_browseruid();
            }

            return true;
        }

        return false;
    }
}
?>

Shibboleth

shib 2016

https://github.com/ivan-novakov/dokuwiki-shibboleth-auth

# git clone https://github.com/ivan-novakov/dokuwiki-shibboleth-auth.git
Cloning into 'dokuwiki-shibboleth-auth'...
remote: Counting objects: 90, done.
remote: Total 90 (delta 0), reused 0 (delta 0), pack-reused 90
Unpacking objects: 100% (90/90), done.

# /tmp/dokuwiki-shibboleth-auth/plugin
# cp -a authshibboleth /var/www/dups/wups/lib/plugins/

Solutions

L'Integration de dokuwiki dans une fédération d'identité shibboleth peut se faire via 2 plugins

Le premier est tres interessent en terme de package d'outils collaboratifs ⇒ sympa pour une mailing liste avec archives et documents partagés + ajout d'un wiki (dokuwiki !) pour l'édition en ligne, le tout agrémente de la puissante gestion de groupe de travail de sympa. Ainsi les droits d'accès aux pages wiki sont associés aux groupes de personnes de la liste, avec en prime la délégation de gestion qui suis ;-) .

Le second, offre en interne une gestion de groupes dynamiques basées sur les attributs recuperés par shibboleth. Il permet aussi de cumuler via un autre plugin un chainage de plugin d'authentification. Cela permet en plus de l'authentification fédérée shibboleth, de conserver également une authentification traditionnelle avec des comptes locaux à l'application, voire d'autres de type d'auth; ldap, sql etc …. cela assure une multiplicité d'origine des comptes .

ci dessous sera présentée dans un premier temps la 2eme solution, plus adaptée à un petit site ne disposant pas d'un large déploiement sympa en parallele (cas de ce site “pages perso” !)

shibboleth auth backend

deploiement

Le déploiement d'un fournisseur de service shibboleth est un préalable et est bien au delà de cette doc, cf https://spaces.internet2.edu/display/SHIB2/Home

La documentation et le téléchargement de ce plugin se fait ici, tout y est expliqué en terme de paramétrage.

Attention, afin de profiter du cumul de systèmes d'auth il ne faut pas utiliser le sous module d'interception de l'action native de Login dokuwiki (ne pas utiliser https://wiki.debug.cz/dokuwiki/plugins/shiblogin) .

Login shibboleth

L'authentification shibboleth est réalisée en ajoutant un lien dans le formulaire de login dokuwiki vers le SessionInitiator du ServiceProvider Shibboleth.

Exemple ~ligne 54 de inc/html.php

$ diff -ur inc/html.php.orig inc/html.php
--- inc/html.php.orig   2009-12-26 21:57:10.000000000 +0100
+++ inc/html.php        2010-01-03 12:27:29.000000000 +0100
@@ -51,6 +51,7 @@

     print p_locale_xhtml('login');
     print '<div class="centeralign">'.NL;
+    print "<center><b>Si vous etes membre de l'Institut Telecom, veuillez vous   connecter en cliquant sur ce lien : <a href='https://www-public.it-sudparis.eu/Shibboleth.sso/WAYFIT?target=http://www-public.it-sudparis.eu/~procacci/dok/'>Connexion</a> </B><a href='https://www-public.it-sudparis.eu/Shibboleth.sso/WAYFIT?target=http://www-public.it-sudparis.eu/~procacci/dok/'> <img src='lib/images/lo  go-IT.gif' alt='logo-IT' align='middle'></a></b></center>";
     $form = new Doku_Form(array('id' => 'dw__login'));
     $form->startFieldset($lang['btn_login']);
     $form->addHidden('id', $ID);

Groupes shib<->dokuwiki

L'association d'un login shibboleth a un groupe dokuwiki est primordiale dans le déploiement d'un wiki a l'échelle d'un population large en terme de consultation et contribution sur le wiki. Dokuwiki offrant un système d'ACL simple mais puissant, nous profitons ici de l'association d'attributs utilisateurs suite à un login shibboleth pour associé a cet utilisateur aux groupes le caractérisant.

Ici nous utilisons l'attribut edupersonAffilliation (valeur types: employee, student, member, staff, affiliate etc …) retourné par shibboleth afin d'y mapper des groupes dokuwiki équivalents, facilitant la gestion d'autorisations sur le wiki.

Le plugin viens avec un fichier de configuration exemple qui documente entre autre ce “mapping” de group

$ cat lib/plugins/dokuwiki_shibauth-0.5.0/conf/example-shibauth-conf.php
<?php

# Example configuration for the Shibboleth Authentication Backend
# Global configuration
# Sets shibboleth authentication
$conf['authtype'] = 'shib';

# Defines the group with superuser permissions
$conf['superuser'] = '@admin';

# Shibboleth configuration
# 'lazy sessions' - Enable/disable lazy sessions
# [ default: false ]
$conf['auth']['shib']['lazy_sessions'] = false;

# 'superusers' - Specify users to be added to the superuser group
$conf['auth']['shib']['superusers'] = array(
    'joe', 'foo'
);

# 'var_remote_user' - The attribute to be used for the user's username
# [ default: REMOTE_USER ]
$conf['auth']['shib']['var_remote_user'] = 'uid';

# 'var_name' - The attribute containing user's name
# [ default: none ]
$conf['auth']['shib']['var_name'] = 'cn';

# 'var_mail' - The attribute containing user's email
# [ default: none ]
$conf['auth']['shib']['var_mail'] = 'mail';

# 'tpl_user_name' - Custom user name template with server variable substitution.
# Allows to customize how users' names appear. If not specified, the attribute specified
# in the 'var_name' option is used.
# Example:
#   - '{cn} ({mail})' - renders the 'cn' attribute followed by 'mail' in brackets
#$conf['auth']['shib']['tpl_user_name'] =

# 'defaultgroup' - The name of the default group for all authenticated users
# [ default: $conf['defaultgroup'] ]
#$conf['auth']['shib']['defaultgroup'] = 'allusers';

# 'admingroup' - The name of the superusers group.
# [ default: 'admin' ]
#$conf['auth']['shib']['admingroup'] = 'administrators';

# 'customgroups' - Enable/disable the use of custom groups
# If enabled, it's possible to define custom user groups in a separate file (see below).
# The file must contain group information in that format:
# $customGroups = array(
#   'group1' => array('user1', 'user2', ...),
#   'group2' => array('user1', 'user2', ...),
#   ...
# );
# [ default: false ]
#$conf['auth']['shib']['customgroups'] = true;

# 'customgroups_file' - Specify a path for the custom groups file
# [ default: DOKU_CONF/custom_groups.php ]
#$conf['auth']['shib']['customgroups_file'] = '/path/to/custom_groups.php';

# 'var_entitlement' - The name of the attribute containing the user entitlement (eduPersonEntitlement)
#$conf['auth']['shib']['var_entitlement'] = 'entitlement';

# 'entitlement_groups' - maps entitlements to user groups, 'var_entitlement' must be set
#$conf['auth']['shib']['entitlement_groups'] = array(
#    'https://www.example.org/special' => 'special_group',
#    'https://www.example.org/internal' => 'internal_group'
#);

# 'debug' - Enable/disable debug. If enabled some info is written to he PHP log.
# [ default: false ]
#$conf['auth']['shib']['debug'] = true;

Dans l'exemple d'application sur l'attribut edupersonAffiliation (ici renommé unscoped-affiliation, attribute-map.xml du SP) cela donne ceci concrètement.

$conf['auth']['shib']['defaultgroup'] = 'shibuser';
$conf['auth']['shib']['var_entitlement'] = 'unscoped-affiliation';

$conf['auth']['shib']['entitlement_groups'] = array(
    'student' => 'student',
    'member' => 'member',
    'invite' => 'invite',
    'employee' => 'employee'
);

Test d'ACL

Afin de verifier l'attribution de groupes, l'action “?do=check” appliquée a une page, permet de voir a quels groupes l'utilisateur actuellement connecté appartient

Exemple http://www-public.it-sudparis.eu/~procacci/dok/doku.php?do=check

affiche:

You are part of the groups shibuser, admins, s2ia, employee

Cela permet ensuite de positionner des ACL sur les namespaces et pages dokuwiki basés sur l'appartenance à ces groupes. exemple de conf/acl.auth.php

docpub:*     @user   1
docITsp:* @ALL    0
docITsp:* @student        1
docITsp:* @member 2
docITsp:galerieimgit:photoslasereuropa    @employee       4
docITsp:systemes:aclinfo  @invite 2

references; forum/debug

Chainage d'authentification

le module auth:ggauth en mode “chained” permet de cumuler plusieurs type d'authentification, shibboleth + local + ldap + sql etc …

ici nous l'utilisons pour cumuler shibboleth à des comptes locaux “plain” pour authentifier des utilisateurs ne participants pas à la fédération.

 $conf['authtype'] = 'chained';
 $conf['auth']['chained']['authtypes'] = 'shib,plain';

config complete

Exemple complet de configuration dokuwiki, shib + groups.

[procacci@arvouin ~/sshfs/public/dok/conf]
$ cat local.php
<?php
/*
 * Dokuwiki's Main Configuration File - Local Settings
 * Auto-generated by config plugin
 * Run for user: PROCACCIA
 * Date: Sun, 03 Jan 2010 12:00:44 +0100
 */

$conf['title'] = 'jehan 2010';
$conf['template'] = 'arctic';
$conf['useheading'] = '1';
$conf['useacl'] = 1;
$conf['authtype'] = 'chained';
$conf['superuser'] = '@admins';
$conf['plugin']['indexmenu']['skip_index'] = '/(sidebars|private:myns)/';
$conf['tpl']['arctic']['left_sidebar_content'] = 'main,toc';
$conf['tpl']['arctic']['right_sidebar_content'] = 'main,toc,user,group,namespace,index';
$conf['plugin']['indexmenu']['replace_idx_depth'] = '3';
$conf['auth']['chained']['authtypes'] = 'shib,plain';
$conf['auth']['chained']['usermanager_authtype'] = 'shib';
$conf['auth']['chained']['find_auth_by_password'] = 'true';
$conf['auth']['shib']['lazy_sessions'] = 'true';
$conf['auth']['shib']['superusers'] = 'array( \'PROCACCI\', \'jehanp\' )';
$conf['auth']['shib']['var_remote_user'] = 'sn';
$conf['auth']['shib']['var_name'] = 'DISPLAYNAME';
$conf['auth']['shib']['var_mail'] = 'mail';
$conf['auth']['shib']['defaultgroup'] = 'shibuser';
$conf['auth']['shib']['admingroup'] = 'admins';
$conf['auth']['shib']['customgroups'] = 'true';
$conf['auth']['shib']['customgroups_file'] = '/proc/public/dok/inc/customs_groups.php';
$conf['auth']['shib']['var_entitlement'] = 'unscoped-affiliation';
#$conf['auth']['shib']['entitlement_groups'] = 'array( \'student\' => \'student\', \'employee\' => \'employee\', \'member\' => \'member\' \'invite\' => \'invite\' )';
$conf['auth']['shib']['entitlement_groups'] = array(
    'student' => 'student',
    'member' => 'member',
    'invite' => 'invite',
    'employee' => 'employee'
);

#$conf['auth']['shib']['debug'] = true;

Création initiale: Main.JehanProcaccia - 09 Jan 2009