VK 提供方在 Users & Permissions 中的设置
页面摘要: VK 提供方在 Users & Permissions 中的设置可通过 VK 启用身份验证。配置一个 VK 应用,然后在 Strapi 的提供方设置中设置客户端 ID、密钥和重定向 URL,以启用 VK 登录。
本页介绍如何为 Users & Permissions 功能 设置 VK 提供方。
WARNING
VK 配置
NOTE
VK 接受 localhost URL。
无需使用 ngrok。
- 访问应用列表页面,地址为 https://vk.com/apps?act=manage
- 点击 Create app(创建应用)按钮
- 填写信息:
- Title(标题):Strapi auth
- Platform(平台):选择 Website(网站)选项
- Website address(网站地址):
http://localhost:1337 - Base domain(基础域名):
localhost
- 在左侧菜单中点击 Settings(设置)链接
- 点击 Open API 链接以启用该选项
- 填写信息:
- Authorized redirect URL(已授权的重定向 URL):
http://localhost:1337/api/connect/vk/callback
- Authorized redirect URL(已授权的重定向 URL):
Strapi 配置
- 访问 User & Permissions 提供方设置页面,地址为 http://localhost:1337/admin/settings/users-permissions/providers
- 点击 VK 提供方
- 填写以下信息:
- Enable:
ON - Client ID:7276416
- Client Secret:cFBUSghLXGuxqnCyw1N3
- 指向你前端应用的重定向 URL:
http://localhost:3000/connect/vk/redirect
- Enable:
你的配置已完成。启动后端和 react 登录示例应用,访问 http://localhost:3000 并尝试连接到你所配置的提供方。