DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:httpauth-passthru

HTTP-Auth-Passthru

If you have already configured a working acl-setup but need http-auth-functionality for, say, the dokuwiki cli, you can set up http-auth-passthru like this:

HTaccess

Open the .htaccess in Dokuwiki's root in your favourite editor and add the following lines to it:

AuthType Basic
AuthName "DokuWiki"

That's all. Don't set a “require valid-user” or something.

local.protected.php

(You can use the local.php, too, but to be safe from the configuration plugin, please do use the local.protected.php!)

Go into your conf-directory and edit (or add) the file “local.protected.php” and add this line:

  if (isset($_SERVER['PHP_AUTH_USER']) and !isset($_SESSION[$conf['title']]['auth']['info'])) $_REQUEST['u'] = $_SERVER['PHP_AUTH_USER'];

(Thanks to this page)

Remember to put a “<?php” at the beginning and an “?>” at the end, if the local.protected.php was empty before.

That's all you need. Now, HTTP-Auth can be used to authenticate against dokuwiki.

tips/httpauth-passthru.txt · Last modified: 2007-10-16 15:34 by dploeger

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki