It's better when it's simple

User Tools

Site Tools




Configuration for authPDO plugin to authenticate with open-source Q&A Forum Questions2Answers.


In this scenario, the intention is to permit the same users who are registered on the forum to make edits in the Wiki. The wiki is not open to all. Users must first register on the forum, after which they can log into the wiki as well using the same credentials.

In this example, the Q2A release is version 1.8beta, running on MySQL. However Q2A 1.7x should work as well.

Note that this does not give a 'single sign-on' experience, but simply enables a user to have the same username/password on both Q2A and the Dokuwiki installation.

Plugin Configuration


In the AuthPDO section, configure the following:

plugin>authpdo>debug Checkbox - enable this for testing, otherwise disable
plugin>authpdo>dsn mysql:host=localhost;dbname=mydatabase;charset=utf8
plugin>authpdo>user <DB-USERNAME>
plugin>authpdo>pass <DB-PASSWORD>
plugin>authpdo>select-user SELECT userid AS uid, passhash AS hash, handle AS name, handle AS user, email AS mail FROM qa_users WHERE handle = :user
plugin>authpdo>select-user-groups SELECT level AS group FROM qa_users WHERE handle = :user
Other fields Leave empty

Note1: uid is right now not used, but probably useful to determine the full name and other profile fields.

Note2: Q2A doesn't have real groups, but only a number for the Admin level. “120” is Super administrator, “100” is Administrator, “50” Editor, “20” Expert & “0” Registered User. As you can set these category specific there are probably other numbers and thus this integration will probably break easily if you set those. I guess these need to be converted from TINYINT to VARCHAR first to work as group names?

TODO: Proper full-name requires to return the “name” value in the select-user query to look up the value of “content” under “qa_userprofile” while filtering for the correct “userid” and “title” (name).

In the Authentication section:

authtype authpdo
passcrypt bcrypt
superuser @120 (Super Administrator in Q2A)
manager @100 (Administrator in Q2A, maybe better @50 for Editor?)
disableactions Uncheck everything to prevent users registering in Dokuwiki
plugin/authpdo/questions2answers.txt · Last modified: 2017-11-21 17:25 by