We'll create fresh WordPress site with Simple Discord SSO ( Single Sign-On ) installed. You have 20 minutes to test the plugin after that site we'll be deleted.
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.
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.
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.
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.