simplesamlphp dokuwiki support

24 views
Skip to first unread message

Rodesch Christian

unread,
Mar 7, 2008, 3:00:56 AM3/7/08
to simple...@googlegroups.com
Hello,

is it possible that the simplesamlphp integration into dokuwiki doesn't
work anymore like it's describes here: http://rnd.feide.no/node/1068 ?
I followed the instructions but php shows a lot of errors about files
that can't be included. I checked this and found out that for example
the file MetaDataStore doesn't exist anymore at all in simplesamlphp.

Thanks in advance

Christian


Andreas Åkre Solberg

unread,
Mar 8, 2008, 6:41:06 PM3/8/08
to simple...@googlegroups.com
Hi, you are right, the dokuwiki integration thing was working with simpleSAMLphp version 0.5

I've uploaded a new file that works with simpleSAMLphp v1.0 (trunk). 

Let me know if it does not as expected. (it may be that there also are some changes needed in the documentation related to the template change etc.).



Rodesch Christian

unread,
Mar 10, 2008, 4:19:28 AM3/10/08
to simple...@googlegroups.com
Hi Andreas,

I just tried the new dokuwiki file but I think there are also some
changes needed in the configuration on the dokuwiki files. I followed
the steps as described here: http://rnd.feide.no/node/1068

But there is no more MetaDataStore.php file in simplesamlphp so this
line in init.php:

require_once('SimpleSAML/XML/MetaDataStore.php');

only brings a PHP error. I deleted the line and the wiki shows up without any errors but when I click on the "login" link it
only reloads the index page. The exact URL is http://dokuwiki.restena.lu/wiki/doku.php?idpentityid=clueless.restena.lu.

Do you know what the problem could be?
You can try it yourself on the wiki: http://dokuwiki.restena.lu/wiki

Thanks

Christian

> andreas...@uninett.no <mailto:andreas...@uninett.no>
>
> http://rnd.feide.no
>

Rodesch Christian

unread,
Mar 10, 2008, 6:16:37 AM3/10/08
to simple...@googlegroups.com
Hello Andreas,

I tried now several things to find out what needs to be adapted in the
template but i cant get it working correctly.In the default template,
the login button points to
http://dokuwiki.restena.lu/wiki/doku.php?idpentityid=clueless.restena.lu

I tried to change it to
http://dokuwiki.restena.lu/wiki/doku.php?do=login&idpentityid=clueless.restena.lu
and I was forwarded to the IdP where I could login as usual, but after
being redirected to the dokuwiki, it shows me the normal dokuwiki login
screen with the username and password fields and the message: You are
currently not logged in! Enter your authentication credentials below to
log in. You need to have cookies enabled to log in.

Now what's weird is that even though he asks me to login, the left
bottom login button changed to "Single Log-Out".

I think the major problem here are the 2 URLs in the main.php template file.

Christian

> andreas...@uninett.no <mailto:andreas...@uninett.no>
>
> http://rnd.feide.no
>

Andreas Åkre Solberg

unread,
Mar 10, 2008, 8:22:59 AM3/10/08
to simple...@googlegroups.com

On Mar 10, 2008, at 11:16 , Rodesch Christian wrote:


Hello Andreas,

I tried now several things to find out what needs to be adapted in the 
template but i cant get it working correctly.In the default template, 
the login button points to 
http://dokuwiki.restena.lu/wiki/doku.php?idpentityid=clueless.restena.lu

I tried to change it to 
http://dokuwiki.restena.lu/wiki/doku.php?do=login&idpentityid=clueless.restena.lu 
and I was forwarded to the IdP where I could login as usual, but after 
being redirected to the dokuwiki, it shows me the normal dokuwiki login 
screen with the username and password fields and the message: You are 
currently not logged in! Enter your authentication credentials below to 
log in. You need to have cookies enabled to log in.

Now what's weird is that even though he asks me to login, the left 
bottom login button changed to "Single Log-Out".

I think the major problem here are the 2 URLs in the main.php template file.

Thanks for testing this. Unfortuneatly I have not time right now to dive into it.

But I uploaded my whole wiki setup here:

The zip file now contains the local.php configuration file, the template directory, as well as the init.php.

Be aware that the init.php may crash if you are running another version of dokuwiki than I, so instead of copying the complete init.php file, take the changes that are added that are relevant to simpleSAMLphp.

Good luck,
kind regards
Andreas

-- 
Andreas Åkre Solberg

Alex Mihic(inac

unread,
Mar 10, 2008, 12:44:33 PM3/10/08
to simple...@googlegroups.com
Hi all!

Rodesch Christian wrote:
> Now what's weird is that even though he asks me to login, the left
> bottom login button changed to "Single Log-Out".
>
> I think the major problem here are the 2 URLs in the main.php template file.

I've managed to config dokuwiki to work with simplesamlphpV1.0pre2.
Those two URLs are OK, they are actually commented out. Perhaps some
part of your config is wrong or missing.


Those are my config files:


local.php
------------------------------------------
$conf['title'] = 'AAI Test';
$conf['template'] = 'default';
$conf['superuser'] = '@wikiadmin';

$conf['useacl'] = 1;
$conf['authtype'] = 'simplesamlphp';
/*
* Specific for simpleSAMLphp integration
*/

$conf['requirelogin'] = 'false';
$conf['groupfile'] = '/home/www/_groups/groups.conf.php';
$conf['simplesamlphp_path'] = '/var/simplesamlphp';
$conf['simplesamlphp_urlprefix'] = 'simplesaml/';
$conf['simplesamlphp_protocol'] = 'saml2';
$conf['defaultidp'] = 'idp.yourhost.org';
------------------------------------------


groups.conf.php
------------------------------------------
<?php
$customgroups = array(
'simplesaml' => array('wikiadmin'),
);
?>
------------------------------------------


part of init.php:
------------------------------------------
// load the config file(s)
require_once(DOKU_CONF.'dokuwiki.php');
if(@file_exists(DOKU_CONF.'local.php')){
require_once(DOKU_CONF.'local.php');
}
}
// Inserted to initialize simpleSAMLphp
$includefile = $conf['simplesamlphp_path'] . '/www/_include.php';

if (!file_exists($includefile)) throw new Exception('Could not
read simpleSAMlphp include file: ' . $includefile);
require_once($includefile);
require_once('SimpleSAML/Utilities.php');
require_once('SimpleSAML/Session.php');
require_once('SimpleSAML/Metadata/MetaDataStorageHandler.php');
require_once('SimpleSAML/XHTML/Template.php');
// Inserted to initialize simpleSAMLphp


//prepare language array
global $lang;
$lang = array();

.
.
.

// init session
if (!headers_sent() && !defined('NOSESSION')){
// session_name("DokuWiki");
// session_set_cookie_params(0, DOKU_REL);
session_start();
}
------------------------------------------


part of main.php (almost whole section is commented out)
------------------------------------------
<div class="bar-right" id="bar__bottomright">
<?php /*
if (isset($_SERVER['REMOTE_USER'])) {

// URL to return user to after authentication. Will be this page :D

$return_url = preg_replace("/idpentityid/", "loggedin",
SimpleSAML_Utilities::selfURL());
$logout_url = '/' . $conf['simplesamlphp_urlprefix'] .
$conf['simplesamlphp_protocol'] . '/sp/initSLO.php?RelayState=' .
urlencode($return_url);

echo '<a href="' . htmlspecialchars($logout_url) . '">Single
Log-Out</a>';
} else {
echo '<a href="?idpentityid=' . $conf['defaultidp'] .'">Login</a>';
} */
?>
<?php tpl_button('subscription')?>
<?php tpl_button('admin')?>
<?php tpl_button('profile')?>
<?php tpl_button('login') ?>
<?php tpl_button('index')?>
<?php tpl_button('top')?>&nbsp;

------------------------------------------


Hope it helps!

--
Best regards,
Alex Mihicinac <al...@arnes.si>
ARNES, Tehnoloski park 18, 1000 Ljubljana, Slovenia
T: +386.1.479.88.00, F: +386.1.479.88.01
W: http://www.arnes.si

Reply all
Reply to author
Forward
0 new messages