Twitch 提供方在 Users & Permissions 中的设置

页面摘要: 通过在 Twitch 开发者控制台注册你的应用程序,并将你的凭据添加到 Strapi 的提供方设置中,为 Strapi 的 Users & Permissions 功能配置 Twitch OAuth 身份验证。

本页介绍如何为 Users & Permissions 功能 设置 Twitch 提供方。

WARNING

Twitch 配置

NOTE

Twitch 接受 localhost URL。

无需使用 ngrok。

  1. 访问开发者控制台上的应用列表页面,地址为 https://dev.twitch.tv/console/apps
  2. 点击 Register Your Application(注册你的应用)按钮
  3. 填写信息:
    • Name(名称):Strapi auth
    • OAuth Redirect URLs(OAuth 重定向 URL):http://localhost:1337/api/connect/twitch/callback
    • Category(类别):选择一个类别
  4. 点击你新应用的 Manage(管理)按钮
  5. 使用 New Secret(新建密钥)按钮生成一个新的 Client Secret(客户端密钥)
  6. 你应该能看到自己的 Application ID 和 secret,请将它们保存以备后用

Strapi 配置

  1. 访问 User & Permissions 提供方设置页面,地址为 http://localhost:1337/admin/settings/users-permissions/providers
  2. 点击 Twitch 提供方
  3. 填写以下信息(替换为你自己的客户端 ID 和密钥):
    • Enable:ON
    • Client ID:amuy279g8wt68qlht3u4gek4oykh5j
    • Client Secret:dapssh10uo97gg2l25qufr8wen3yr6
    • 指向你前端应用的重定向 URL:http://localhost:3000/connect/twitch/redirect

你的配置已完成。启动后端和 react 登录示例应用,访问 http://localhost:3000 并尝试连接到你所配置的提供方。