DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:authgooglesheets

Differences

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

Link to this comparison view

Next revision
Previous revision
plugin:authgooglesheets [2022-04-28 14:06] – created anndaplugin:authgooglesheets [2022-06-27 13:35] (current) – version upped andi
Line 6: Line 6:
 email      : dokuwiki@cosmocode.de email      : dokuwiki@cosmocode.de
 type       :  type       : 
-lastupdate : 2022-04-28+lastupdate : 2022-06-21
 compatible : Hogfather compatible : Hogfather
 depends    :  depends    : 
Line 33: Line 33:
 ===== Configuration ===== ===== Configuration =====
  
-You need to set up a service account that will be used by DokuWiki to access the Google Sheets API.+You need to set up a **service account** that will be used by DokuWiki to access the Google Sheets API.
  
   * Go to https://console.cloud.google.com/apis/   * Go to https://console.cloud.google.com/apis/
   * Select an existing project at the top or create a new one   * 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+  * 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   * 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.     * 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.+    * 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 [[:farms|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.+Prepare the **spreadsheet** that will store the users.
  
-  * Create a new document and save its ID in the plugin configuration. You will find the ID in the URL, for example  https://docs.google.com/spreadsheets/d/**111111111111111111111111111111111**/edit#gid=0 +  * 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 **first** sheet will contain users. Name it ''DokuWikiAuth''. If you prefer something else, change the name in the plugin configuration as well!+  * The sheet/table/tab that contains users is addressed by name **and** by ID. 
 +    * Name it ''DokuWikiAuth''. If you prefer something else, change the ''sheetName'' in the plugin configuration as well!  
 +    * Set the ''sheetGid'' to the ''gid'' parameter you find it the URL.
   * Create a header row with at least the required column names:   * Create a header row with at least the required column names:
     * user     * user
Line 57: Line 59:
  
 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. 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 ===== ===== Development =====
plugin/authgooglesheets.1651147593.txt.gz · Last modified: 2022-04-28 14:06 by annda

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