Table of Contents
authgooglesheets Plugin
Compatible with DokuWiki
- 2024-02-06 "Kaos" unknown
- 2023-04-04 "Jack Jackrum" unknown
- 2022-07-31 "Igor" unknown
- 2020-07-29 "Hogfather" yes
This plugin enables user management in Google Sheets. Internally it replaces the user file with a Google Sheet.
Installation
External requirements: Google Sheets access. See Configuration section for details.
Install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
Configuration
You need to set up a service account that will be used by DokuWiki to access the Google Sheets API.
- Select an existing project at the top or create a new one
- Go to “Enabled APIS and services” and make sure Google Sheets API is enabled. No other services are required.
- Then go to “Credentials” and create a service account
- In the “Keys” tab of your new service account create a new key of the type JSON.
- Your browser will automatically download the key. Store it in a secure location and place a copy named
authgooglesheets_credentials.json
in the conf/ directory of your wiki. If you have a farm setup, you will need to put the file in your animal's conf/ directory, not the farmer's.
Prepare the spreadsheet that will store the users.
- Create a new document and save its
sheetId
in the plugin configuration. You will find the ID in the URL, for example https://docs.google.com/spreadsheets/d/111111111111111111111111111111111/edit#gid=0 - The sheet/table/tab that contains users is addressed by name and by ID.
- Name it
DokuWikiAuth
. If you prefer something else, change thesheetName
in the plugin configuration as well! - Set the
sheetGid
to thegid
parameter you find it the URL.
- Create a header row with at least the required column names:
- user
- pass
- name
- mail
- grps
- created
- lastlogin
- Share the document with your service account. Otherwise DokuWiki will not be able to write data to it.
You can store any additional information about the users in the document, either as additional columns or in a new sheet. This will not affect login or user management.
Initial User Setup
Before you switch to the new authentication method in the Configuration Manager, make sure you have at least a viable superuser in your Google Sheet. It is recommended to start with plain authentication and transfer the data from conf/users.auth.php
file to your sheet. It cannot be done by simple CSV export and import, because password hashes are NOT included in the CSV. More information about the structure of user data is available in the acl documentation.
Development
Change Log
- Respect cache expiration (2022-06-21 17:53)
- Working pagination in user manager (2022-06-02 22:18)
- Version bump (2022-06-01 21:00)
- Fix user count (2022-06-01 20:57)
- Version upped (2022-05-23 23:50)
- Cache column map (2022-05-23 16:02)
- Version upped (2022-05-18 23:50)
- Use cache to minimize number of API requests (2022-05-18 12:45)