Skip to main content

用户和权限的 VK 提供商设置

¥VK provider setup for Users & Permissions

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

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

Prerequisites

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

¥You have read the Users & Permissions providers documentation.

VK 配置

¥VK configuration

注意

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

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

  1. 访问应用列表页面 [https://vk.com/apps?act=manage](https://vk.com/apps?act=manage) 

    ¥Visit the Apps list page at https://vk.com/apps?act=manage 

  2. 单击创建应用按钮

    ¥Click on Create app button

  3. 填写信息:

    ¥Fill the information:

    • 标题:Strapi 授权

      ¥Title: Strapi auth

    • 平台:选择网站选项

      ¥Platform: Choose Website option

    • 网站地址:http://localhost:1337

      ¥Website address: http://localhost:1337

    • 基域:localhost

      ¥Base domain: localhost

  4. 单击左侧菜单中的“设置”链接

    ¥Click on the Settings link in the left menu

  5. 单击 Open API 链接以启用此选项

    ¥Click on the Open API link to enable this option

  6. 填写信息:

    ¥Fill the information:

    • 授权重定向网址:http://localhost:1337/api/connect/vk/callback

      ¥Authorized redirect URL: http://localhost:1337/api/connect/vk/callback

表带配置

¥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. 点击 VK 提供商

    ¥Click on the VK provider

  3. 填写信息:

    ¥Fill the information:

    • 使能够:ON

      ¥Enable: ON

    • 客户编号:7276416

      ¥Client ID: 7276416

    • 客户秘密:cFBUSghLXGuxqnCyw1N3

      ¥Client Secret: cFBUSghLXGuxqnCyw1N3

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

      ¥The redirect URL to your front-end app: http://localhost:3000/connect/vk/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.