Skip to main content

用户和权限的 Discord 提供程序设置

¥Discord provider setup for Users & Permissions

本页面说明如何为 用户和权限功能 设置 Discord 提供程序。

¥The present page explains how to setup the Discord provider for the Users & Permissions feature.

Prerequisites

你已阅读 用户和权限提供商文档

¥You have read the Users & Permissions providers documentation.

Discord 配置

¥Discord configuration

注意

Discord 接受 localhost 网址。
不需要使用 ngrok

¥Discord accepts the localhost urls.
The use of ngrok is not needed.

  1. 访问开发者门户上的应用列表页面 [https://discordapp.com/developers/applications/](https://discordapp.com/developers/applications/) 

    ¥Visit the Apps list page on the developer portal at https://discordapp.com/developers/applications/ 

  2. 单击新应用按钮

    ¥Click on New application button

  3. 填写名称并创建

    ¥Fill the name and create

  4. 单击左侧菜单中的 OAuth2

    ¥Click on OAuth2 in the left menu

  5. 然后单击添加重定向按钮

    ¥And click on Add redirect button

  6. 在重定向输入中填写 http://localhost:1337/api/connect/discord/callback URL 并保存

    ¥Fill the Redirect input with http://localhost:1337/api/connect/discord/callback URL and save

  7. 单击左侧菜单中的一般信息

    ¥Click on General information in the left menu

  8. 你应该会看到你的应用 ID 和密码,保存起来供以后使用

    ¥You should see your Application ID and secret, save them for later

表带配置

¥Strapi configuration

  1. 访问用户和权限提供商设置页面位于 [http://localhost:1337/admin/settings/users-permissions/providers](http://localhost:1337/admin/settings/users-permissions/providers) 

    ¥Visit the User & Permissions provider settings page at http://localhost:1337/admin/settings/users-permissions/providers 

  2. 单击 Discord 提供商

    ¥Click on the Discord provider

  3. 填写信息(替换为你自己的客户端 ID 和密码):

    ¥Fill the information (replace with your own client ID and secret):

    • 使能够:ON

      ¥Enable: ON

    • 客户编号:665118465148846081

      ¥Client ID: 665118465148846081

    • 客户秘密:iJbr7mkyqyut-J2hGvvSDch_5Dw5U77J

      ¥Client Secret: iJbr7mkyqyut-J2hGvvSDch_5Dw5U77J

    • 前端应用的重定向 URL:http://localhost:3000/connect/discord/redirect

      ¥The redirect URL to your front-end app: http://localhost:3000/connect/discord/redirect

你的配置已完成。启动后端和 react login 示例应用 ,转到 http://localhost:3000 并尝试连接到你配置的提供商。

¥Your configuration is done. Launch the backend and the react login example application , go to http://localhost:3000 and try to connect to the provider you configured.