Linux 软件免费装
Banner图

Simple Discord SSO ( Single Sign-On )

开发者 jaycodez
更新时间 2022年1月20日 08:41
PHP版本: 7.4 及以上
WordPress版本: 5.8.3
版权: GPLv2 or later
版权网址: 版权信息

标签

social login discord discord server discord login

下载

1.0.2

详情介绍:

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: 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.

安装:

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.

屏幕截图:

  • The login button.
  • Logo Colors.
  • Button Background Colors.

常见问题:

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.

更新日志:

1.0.2 1.0.1 1.0.0