DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:oauthdiscordserver

oauthdiscordserver Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" yes
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" unknown
  • 2020-07-29 "Hogfather" unknown

plugin Discord Service for use with the oAuth2 Plugin, while requiring membership within a particular server, and optionally a particular server role

Last updated on
2025-04-04
Provides
Action
Repository
Source
Conflicts with
oauthdiscord
Requires
oauth

Similar to oauthdiscord

Tagged with authentication, oauth

By GeorgeTR1

Installation

:!: External requirements: This plugin requires the oAuth Plugin.

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

Usage

Based on the oauthdiscord Plugin, this plugin allows only Discord users who are members of a particular Discord server to login, and optionally only users with a particular role on that server. Install this plugin instead of the oauthdiscord plugin, not both.

Implementation Details

Unlike the oauthdiscord plugin, this plugin doesn't request the email address associated with a Discord user account, which is better in my opinion, since there really isn't a reason why DokuWiki needs to know this, and it therefore increases user privacy. The only reason to have your email on DokuWiki is to reset your password, which is no longer necessary if all users are authenticating with Discord; or to manage subscriptions to certain pages, but that ability is turned off by default, and is not something I think is necessary in most cases. Instead, a fake email address is created for each user, in the format <Discord User id>@discord.com. This ensures that every user has a unique email address.

Usernames and real names are set to be the same, although since usernames must be all lowercase and have no whitespace, they will be appropriately modified. The preferred source of a user's name is their server nickname on the server that is required to log in, and if they don't have one, their Discord display name is used, and if they don't have one of those, their Discord username is used.

Configuration and Settings

  • You must select oauth in the authtype config option, as shown in the installation instructions for the oAuth Plugin.
  • You need to set the Client ID and Secret of your Discord oAuth2 application from the Developer Portal.
  • You also need to set the Server ID of the server that all users must be members of in order to login. To get this, you will need to first turn on developer mode in your Discord user settings, and then right clicking a server will give you the option to copy its ID to the clipboard.
  • You can also set a role within that server that users are required to have in order to login; to do this set the Role ID, which can be retrieved by right clicking like the Server ID.

For a wiki where all users must login with Discord as a means to restrict access to the wiki, which is the typically intended use case, it is highly recommended that you set the following other configuration settings:

  • Enable the singleService option in the Oauth configuration
    • This forces all users to login through Discord, instead of the standard login
  • Disable the Update Profile action in the disableactions config option
    • If there is expected to be a one-to-one correspondence between the names of people on the wiki and their names in a Discord server, as is the case initially, allowing users to change their name would create confusion. Also, changing passwords serves no purpose, and changing email breaks the system.
  • Set the showuseras config option to either username or username_link (shown in the Configuration Manager as “User's full name” or “User's full name as interwiki user link”)
    • Full names are the same as login names, except that they preserve the capitalization and whitespace of the original Discord names, so they are preferred. Select username_link if you expect people to want to create their own user pages. In this case, installing a plugin like the Userpage Plugin would be advised.
  • Ensure that subscribing to email notifications to pages is disabled (this is the case by default)
    • Since all emails are fake, subscription notifications won't work
plugin/oauthdiscordserver.txt · Last modified: by 184.100.54.41

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