DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:authdjango

AuthDjango Plugin

Compatible with DokuWiki

  • 2025-05-14 "Librarian" unknown
  • 2024-02-06 "Kaos" yes
  • 2023-04-04 "Jack Jackrum" yes
  • 2022-07-31 "Igor" yes

plugin

Last updated on
2025-04-19
Provides
Auth
Repository
Source

Tagged with auth, authentication, django

This plugin allows to authenticate users using a running Django installation. It uses the session of Django, thus the users need to login via Django first. A connection to the Django database is required.

Installation

Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

Configuration and Settings

Set the following fields in Dokuwiki configuration

  • authtype to authdjango
  • Under plugin»authdjango set
    • protocol: Database type of Django database (currently supported: pgsql, mysql, sqlite)
    • server: Hostname or file (sqlite) of Django database
    • user: Database username of Django database (empty for sqlite)
    • db: Database name of Django database (empty for sqlite)
    • password: Database password for Django database (empty for sqlite)
    • logoff_uri: An URI that logs out a Django session (e.g. “https://example.com/accounts/logout/?next=/wiki/”)
    • admin_admin: Set if all Django admins should be dokuwiki admins
    • staff_admin: Set if all Django staff should be dokuwiki admins

Alternatively, set in conf/local.php:

$conf['authtype'] = 'authdjango';
$conf['plugin']['authdjango']['server'] = '';
$conf['plugin']['authdjango']['user'] = '';
$conf['plugin']['authdjango']['db'] = '';
$conf['plugin']['authdjango']['password'] = '';
$conf['plugin']['authdjango']['protocol'] = 'pgsql'; // or other, see PHP PDO documentation
$conf['plugin']['authdjango']['logoff_uri'] = '';
$conf['plugin']['authdjango']['admin_admin'] = 1;
$conf['plugin']['authdjango']['staff_admin'] = 0;

Development

Change Log

  • 2025-04-19
    • Fixed CRITICAL bug that every Django user with an email address would get admin rights in dokuwiki
    • Fix bug that logout button was shown even if logoff URI was not set
  • 2025-04-18
    • Support for Django 4 and newer
    • Make all users members of dokuwiki group 'users'
    • Options to make Django admins and staff members of dokuwiki group 'admin'
    • Add new config option to set logoff URI (enables logout button in dokuwiki)
  • 2018-03-29
    • Add config defaults and config description strings
    • Some bugfixes
  • 2018-03-29
    • Initial release, based on django

Known Bugs and Issues

ToDo/Wish List

FAQ

Discussion

Note that as of Django 3.1, your Django project seems to require

  DEFAULT_HASHING_ALGORITHM='sha1' 

in your settings.py for this Authdjango plugin to read everything correctly. While that doesn't explicitly makes sense, for now it appears to be needed.

See the release notes for Django 3.1 for more details

[Update: ] With the new updates of this plugin to support Django 4, the setting above might no longer be necessary.

plugin/authdjango.txt · Last modified: by 2001:4dd0:2426:0:8aae:5c59:476f:5cdf

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