It's better when it's simple

User Tools

Site Tools


Magento Plugin

Compatible with DokuWiki

Ponder Stibbons, Hrun

plugin Authenticate against customer and administrator information found in Magento databases

Last updated on

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with authentication, magento

By Z3Dev


Setup Database Access

This plugin uses the PHP Data Objects (PDO) interfaces to interact with the Magento database. As such, the MySql PDO module must also be installed and available for PHP.

A new database user should be created for accessing the Magento database. In addition, the new database user needs select permissions on the Magento tables.

  mysql -u root -p
  mysql> create user ‘dokuwiki’@‘localhost' identified by ‘strong-password’;
  mysql> grant select on magento-db.* to ’dokuwiki’@‘localhost';

And test access.

  mysql -u dokuwiki -p
  mysql> use magento-db;
  mysql> select * from customer_entity;

Install the Plugin

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

Once installed, follow the initial steps in the Configuration section below.

Reverting to authplain

If the plugin cannot be installed successfully due to host or database restrictions then you can revert to authplain by editing conf/local.php, and changing the following line:

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


This plugin allows users to be authenticated against the customer and the administrator information found in Magento databases. (Note: Access to customer and administrator information is configurable.)

Magento customers login with both first and last names, e.g. Doku Wiki. The plugin will search the Magento customer information for a perfect match to both first and last names. Note: If there is more than one user with the same first and last name then login is denied and a message is displayed.

Magento administrators login with the same “user” that is used for the Magento backend. The plugin will search the Magento administrator information for a perfect match.

If a user (or administrator) is found then the password provided at login will be hashed and compared to that found in the Magento database. At this time, only the standard MD5 hash is supported, so only Magento CE is supported.

In addition to the customer groups provided by Magento, additional groups can be configured to make Magento customers and Magento administrators unique in DokuWiki. The default groups for Magento administrators is “admin”, but this can be changed.

This plugin does NOT provide:

  • Creation, modification, or deletion of customers. Use Magento.
  • Creation, modification, or deletion of customer groups. Use Magento.
  • Creation, modification, or deletion of administrators. Use Magento.
  • Creation, modification, or deletion of administrator roles. Use Magento.

In summary, use Magento for administration of customers, customer groups, administrators, and administrator roles. Use DokuWiki for maintaining documentation.

A Final Note: This plugin does not store password hashes in memory. The database is always accessed for the password hashes for security reasons.

Configuration and Settings

The easiest way to configure the new authentication is to add the following lines to the end of conf/local.php. Of course, you need to change dbname, user, and password in order to access the MySql database.

$conf['plugin']['magento']['databaseDSN'] = 'mysql:host=localhost;dbname=magento-db';
$conf['plugin']['magento']['databaseUser'] = 'dokuwiki';
$conf['plugin']['magento']['databasePassword'] = 'strong-password';

Then change the authentication to the new magenta plugin by making these changes in conf/local.php.

//$conf['authtype'] = 'authplain';
$conf['authtype'] = 'magento';

If successful then you should be able to log into the DokuWiki using any of the administrator users names, i.e. the same user name used on the Magento backend. And if 'admin' is the Super User group then the administrator should be able to access the DokuWiki configuration.

Name Description Type Default Value
databaseDSN Database Source Name (DSN) for PDO connections. string mysql:host=localhost;dbname=magento-db
databaseUser Effective User for database connections. string dokuwiki
databasePassword Password (if any) used to establish database connections. password password
debugDatabase Should database exceptions be shown? onoff 1
includeCustomers Should Magento customers be available as DokuWiki users? onoff 1
includeGroups Should Magento customer groups be available as DokuWiki groups? onoff 1
includeDefaultGroup Should users (and admins) be assigned to the DokuWiki default group? See the Authentication section. onoff 1
userGroups Special groups to assign to each Magento customer. string
includeAdmins Should Magento administrators (Users) be available as DokuWiki users? onoff 1
includeRoles Should Magento administrator roles be available as DokuWiki groups? onoff 1
adminGroups Special groups to assign to each Magento administrator. string admin

WARNING: Be sure the Superuser setting is still valid after changing settings.


Known Bugs and Issues

Please report bugs and feature requests at issue tracker.



Does the plugin support Magento CE?

Yes. At this time, only the standard MD5 hash is supported, so only Magento CE is supported.

What versions of Magento does this plugin support?

The plugin has only been tested with Magento CE 1.8.10.

plugin/magento.txt · Last modified: 2018-06-04 23:24 by Klap-in