# VK ID OAuth 2.1 认证用于 Discourse

**URL:** https://meta.discourse.org/t/vk-id-oauth-2-1-authentication-for-discourse/388073
**Category:** Plugin
**Created:** [2025年十一月10日 20:10 UTC](https://meta.discourse.org/t/vk-id-oauth-2-1-authentication-for-discourse/388073 "2025-11-10T20:10:30Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![kaktak](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kaktak/32/529093_2.png) [@kaktak](https://meta.discourse.org/u/kaktak)
#### Post date: [2025年十一月10日 20:10 UTC](https://meta.discourse.org/t/vk-id-oauth-2-1-authentication-for-discourse/388073/1 "2025-11-10T20:10:30Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **摘要** | 带有 VK ID 的 OAuth 2.1 身份验证插件 |
| 🛠 | **存储库链接** | \u003chttps://github.com/kaktaknet/discourse-vkid-oauth\u003e |
| 📖 | **安装指南** | [如何在 Discourse 中安装插件](https://meta.discourse.org/t/install-plugins-in-discourse/19157) |

  

### 功能

🔐 Discourse 的 VK ID 身份验证。带有 VK ID 的 OAuth 2.1 身份验证插件。

### 配置

在 [id.vk.ru](https://id.vk.ru/about/business/go) 注册的应用程序

> **摘要**
>
> ## ⚙ 配置
> 
> ### 创建 VK ID 应用程序
> 
> 1. 转到 **[VK ID 控制台](https://id.vk.ru/about/business/go)**
> 2. 点击 **“创建应用程序”**
> 3. 选择 **“网站”** 平台
> 
> ### 配置 OAuth
> 
> **重定向 URI：**
> 
> ```plaintext
> https://your-discourse-site.com/auth/vkid/callback
> 
> ```
> 
> **范围：**
> 
> - ✅ `vkid.personal_info`（必需）
> - ✅ `email`（推荐）
> - ✅ `phone`（可选）
> 
> **PKCE：** ✅ 必须启用

### 设置

#### Discourse 设置

导航到： **管理员 → 设置 → 登录**

| 设置 | 值 | 描述 |
| --- | --- | --- |
| `vkid_enabled` | ✅ | 启用 VK ID 身份验证 |
| `vkid_client_id` | `123456` | 来自 VK ID 控制台的应用 ID |
| `vkid_client_secret` | `••••••` | 来自 VK ID 的密钥 |
| `vkid_scope` | `vkid.personal_info email phone` | OAuth 范围 |

> **屏幕截图**
>
> ![Vkid-oauth](https://global.discourse-cdn.com/meta/original/4X/e/2/9/e29590b28113e48dffa98e81940c0b7525d625b8.png)

---

_[View the full topic](https://meta.discourse.org/t/vk-id-oauth-2-1-authentication-for-discourse/388073)._
