Allow any Discord user to sign in to your website and save their discord user information for later use.

Overview

Simple Discord SSO ( Single Sign-On )

Requires at least: 5.0
Tested up to: 5.8.3
Stable tag: 1.0.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

This plugin allows discord users ( verified or not ) to login to your WordPress website as a subscriber. With a slew of available hooks developers are able to both listen to, and customize, various events during the login process. Complete with a customizable login button, or you can code your own and unhook this one.

Important Caching Information

This plugin uses a custom rewrite rule for the login button. You may want to ensure the /discord-login path in your WordPress installation is not cached.

Saved User Data

When logging in, if the user does not have an account one is created for them automatically using their Username and Discriminator field. The default scope is identify email which allows your site to store their discord information to your database for other discord-related usage.

The following fields are saved to the simple_discord_sso user meta key for all discord users:

  • id: the user's id
  • avatar: the user's avatar hash
  • discriminator: the user's 4-digit discord-tag
  • public_flags: the public flags on a user's account
  • flags: the flags on a user's account
  • banner: the user's banner hash
  • accent_color: the user's banner color encoded as an integer representation of hexadecimal color code
  • locale: the user's chosen language option
  • mfa_enabled: whether the user has two factor enabled on their account
  • premium_type: the type of Nitro subscription on a user's account
  • verified: whether the email on this account has been verified
  • hash: Just an MD5 hash which is used to determine if these fields should be updated on every login.

Various actions and filters are available, should you want to expand on these fields ( if new fields are added ) just look over the Discord User Resource for more fields.

Actions/Filters

Various actions and filters are available from changing the redirect URL after login, changing the scope of the discord request, or even halting the login ( and maybe redirecting after ) depending on the user's discord information. Or, even if you want, you can listen for the login and hook into right before the redirect. The goal with the slew of actions and filters is to allow developers to customize the plugin how they see fit.

Think we need more? Awesome, open a ticket on the GitHub Repository - the plugin is actively maintained so I'd be happy to help out.

Installation

From your WordPress dashboard

  1. Visit Plugins > Add New.
  2. Search for Simple Discord SSO. Find and Install Simple Discord SSO.
  3. Activate the plugin from your Plugins page.

From WordPress.org

  1. Download Simple Discord SSO.
  2. Unzip and upload the simple-discord-sso directory to your /wp-content/plugins/ directory.
  3. Activate Simple Discord SSO from your Plugins page.

Post Installation

You will now need to create an App on discord. To do that follow the below instructions:

  1. Sign-in to discord and create an app on the Dashboard.
  2. Name your app something obvious ( WordPress SignOn for example )
  3. Fill out the initial information for legal reasons, it's suggested ( but not required ) you have a Terms of Service page and a Privacy Policy if you are using this plugin.
  4. Click OAuth2 on the left sidebar.
  5. Click General under OAuth2.
  6. You must add a redirect back to your site. So click Add Redirect and enter your site's full URL to the WordPress install.
  7. Copy the Client ID and the Client Secret
  8. Now log into your WordPress installation and navigate to WP Admin > Discord SSO
  9. Add the Client ID and Client Secret to your settings. Click Save/Update.
  10. Your site is now allows Discord users to sign in.

Frequently Asked Questions

How can I change user roles from subscriber when they sign in

There's a filter for that. It's simple_discord_sso/default_role which defaults to subscriber and also receives the user resource array from the Discord API.

How can I change the URL they're redirected to?

There's a filter for that. It's simple_discord_sso/login_redirect which defaults to home_url() and also receives the WP_User object.

How do I allow users to login without using wp-login.php?

To use the login, you only need to redirect the user to /discord-login - this is a custom rewrite to fire off the sign-on process. Alternatively you can use the query parameter instead /?discord=1.

Changelog

1.0.2

  • Small versioning update for plugin submission.
  • Automatically update permalinks if required on init.

1.0.1

  • Small updates to readme

1.0.0

  • Initial release.
You might also like...
CRUD  Build a system to insert student name information, grade the class name, and edit and delete this information
CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

CRUD Build a system to insert student name information, grade the class name, and edit and delete this information

All about docker projects either from dockerfile or compose. Anyway, here the project is in the form of a service, for the programming language I will make it later
All about docker projects either from dockerfile or compose. Anyway, here the project is in the form of a service, for the programming language I will make it later

Docker Project by ItsArul Hey, yo guys okay, this time I made some projects from Docker. Anyway, this project is open source, for example, if you want

      Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.
Disclaimer: The documentation of this plugin is English at the moment, but I might go for Latin later down the line, just for the fun of it.

Quiritibus Plugin This repository is storing the custom plugin developed for the Quiritibus Latin Magazine website, currently being developed at: http

Project that aims to create a website for a gym, where the clients and employees can access their data, buy in the gym store and check the gym activities.

Gym_Management_Project Project that aims to create a website for a gym, where the clients and employees can access their data, buy in the gym store an

Magento 2 Megamenu extension is an indispensable component, and plays the role of website navigation to help customers easily categorize and find information
Magento 2 Megamenu extension is an indispensable component, and plays the role of website navigation to help customers easily categorize and find information

Mageno 2 Mega Menu (Magicmenu) helps you create neat and smart navigation menus to display the main categories on your website.

PHP Unoconv - An Object Oriented library which allow easy to use file conversion with Unoconv.

An Object Oriented library which allow easy to use file conversion with Unoconv. Install The recommended way to install PHP-Unoconv is thr

Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ 😍 Inst

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

Comments
  • Feature request: Authenticate against a particular server

    Feature request: Authenticate against a particular server

    I've added this to my wordpress site and its working well so far (thank you!).

    I was able to modify the role that users end up in, since that was a simple value change, but I would like to restrict authorization to users who are already members of a particular server. This seems be possible, it was implemented in this nextcloud social sign in plugin: https://github.com/zorn-v/nextcloud-social-login/issues/132 but I am not a developer myself, and this implementation is in a plugin that has a much broader scope so I'm not sure how best to proceed.

    It seems like I would need to:

    • Call the API for the users guilds: users/@me/guilds
    • Check the list for one particular ID (Guild.ID), which I could just hard code into the authentication.php

    Any guidance on how to go about adding that would be great!

    opened by LauraMakesArt 0
  • Redirection

    Redirection

    Hello, can i have home help with the redirection settings please? I did edit /scr/lib/Discord.php like this but i'm not redirected after login

    	public function get_redirect_url(): string {
    		return apply_filters( 'simple_discord_sso/redirect_url', 'https://example.com' );
    	}
    

    Did i miss something?

    Thanks

    opened by censorshipm 5
Releases(1.0.2)
Owner
WordPress Developer - Minecraft Geek - Gamer - Father of 3. Tell me a coding problem can't be solved, and I'll prove you're wrong.
null
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
Save items in a bucket, retrieve them later.

Bucket Save items in a bucket, retrieve them later. use Laragear\Bucket\Facades\Buckets; use App\Models\Message; public function send(Message $messag

Laragear 2 Jun 3, 2022
A web application built on PHP for user to view their credit information in their mysql database

TheCreditInfo Table of Content About Inspiration Technologies Client Pages Usage About Credere is a website created to help you track your credit hist

Abdul-Baseet Shabi 0 Jul 21, 2022
Track any ip address with IP-Tracer. IP-Tracer is developed for Linux and Termux. you can retrieve any ip address information using IP-Tracer.

IP-Tracer is used to track an ip address. IP-Tracer is developed for Termux and Linux based systems. you can easily retrieve ip address information using IP-Tracer. IP-Tracer use ip-api to track ip address.

Rajkumar Dusad 1.2k Jan 4, 2023
Allow your users to login with their Ethereum wallet.

Allow your users to login with their Ethereum wallet Allow your users to link their Ethereum wallet to their account to skip entering their login cred

Miguel Piedrafita 84 Nov 7, 2022
Library download currency rate and save in database, It's designed to be extended by any available data source.

Library download currency rate and save in database, It's designed to be extended by any available data source.

Flexmind. Krzysztof Bielecki 2 Oct 6, 2021
DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...

DiscordLookup Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more... Website Getting Help Tool

Felix 69 Dec 23, 2022
Backwards compatibility Extension and Library for PHP 8.x and later

colopl_bc Provides various compatibility functions required for PHP (temporary) migration. WARNING This extension is intended for temporary use only.

COLOPL,Inc. 10 Jun 13, 2023
Michael Pratt 307 Dec 23, 2022