DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:httpauth-passthru

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

tips:httpauth-passthru [2007-10-16 15:33]
dploeger created
tips:httpauth-passthru [2007-10-16 15:34] (current)
dploeger
Line 1: Line 1:
 +====== HTTP-Auth-Passthru ======
 +
 +If you have already configured a working acl-setup but need http-auth-functionality for, say, [[tips:tofromdoku|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:
 +
 +<code>
 +AuthType Basic
 +AuthName "DokuWiki"
 +</code>
 +
 +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:
 +
 +<code php>
 +  if (isset($_SERVER['PHP_AUTH_USER']) and !isset($_SESSION[$conf['title']]['auth']['info'])) $_REQUEST['u'] = $_SERVER['PHP_AUTH_USER'];
 +</code>
 +
 +(Thanks to [[tips:htaccessauth|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