# Discourse를 OAuth2/OIDC Provider로 지원하기

**URL:** https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924
**Category:** Extras
**Created:** [6월 19, 2025, 4:22오후 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924 "2025-06-19T16:22:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cuo\_wu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cuo_wu/32/498442_2.png) [@cuo\_wu](https://meta.discourse.org/u/cuo_wu)
#### Post date: [6월 19, 2025, 4:22오후 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924/1 "2025-06-19T16:22:48Z")

</div>

| | | |
| --- | --- | --- |
| ℹ | **요약** | Oauth2/OIDC 제공자. 사용자가 자신의 앱을 생성할 수 있습니다. |
| 🛠 | **다운로드 링크** | [https://vvpp.cc/s/GPmCV](https://vvpp.cc/s/GPmCV) |

  

### 기능

우리는 Discourse가 공식적으로 Oauth2/OIDC 제공자 역할을 수행하는 솔루션을 사용하지 않는다는 것을 알고 있습니다.

서비스를 더 잘 구현하고, 모두가 더 많은 아이디어를 NL에 가져올 수 있도록 하기 위해, NL은 [Parkour-Vienna/distrust: Use discourse as an OIDC (OAuth 2.0) provider](https://github.com/Parkour-Vienna/distrust)를 기반으로 사용자가 직접 앱을 신청할 수 있는 Oauth2/OIDC 제공자를 구현했습니다.

### 설정

사용자 관련 데이터는 Mysql에 저장하므로, 구체적인 사용 방법은 먼저 Mysql/MariaDB를 설치하고 SQL 스크립트를 실행하여 데이터베이스를 생성하는 것입니다. 그런 다음 `distrust.yml`을 설정하여 데이터베이스 관련 내용을 구성하고, `distrust genkey`를 실행하여 해당하는 RSA 키를 생성합니다. 마지막으로 Discourse 관리 콘솔에서 [Discourse Connect](https://meta.discourse.org/t/13045?silent=true) 제공자를 생성하고 관련 정보를 입력합니다.

그런 다음 다음을 실행합니다.

```plaintext
chmod _+x distrust
./distrust

```

`IP:3000/apps`에 액세스하면 앱 인터페이스를 볼 수 있습니다.

### 데모

 ![The image shows a user interface for an Open Authorization 2.0 (OATH2) app dashboard with options to create a new application. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/4/c/a/4ca50d27fe3531bb743be483d97e937e4e42e4d4.png)

 ![A screenshot of the OAuth2 application creation form with fields for application name, description, redirect URLs, allowed groups, and denied groups. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/1/8/7/187631cfc3f09396471dd9a366bd5872174ca66a.png)

 ![The image shows a successful OAuth2 application creation page with a warning to save the client secret securely. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/2/a/1/2a1df027707cd73feb89ac5c6cc6fb6d3dbcefe2.png)

 ![This image shows a screenshot of a software application interface displaying OAuth2 applications with a single active application named 'Test', along with its client ID, status, and creation date. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/9/8/e98dc0cf71d4b85c8a89c17f0dc1929fa12d907f.png)

사용자가 Oauth2/OIDC 로그인을 사용할 때.

 ![This image shows an authorization screen where the application named 'frenxodeloc' is requesting to access the user's profile and Discord group memberships via OpenID Connect. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/f/2/1/f217b5927260518a97776e24ced28912b92d240f.png)

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [6월 20, 2025, 5:51오전 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924/2 "2025-06-20T05:51:35Z")

</div>

> [@cuo\_wu](#):
>
> | | | |
> | --- | --- | --- |
> | ℹ | **요약** | Oauth2/OIDC 프로바이더. 사용자가 자신의 앱을 생성할 수 있습니다. |
> | 🛠 | **다운로드 링크** | [VVPP.CC](https://vvpp.cc/s/GPmCV) |
> 
> ### 기능
> 
> Discourse에는 Discourse를 Oauth2/OIDC 프로바이더로 사용하기 위한 공식 솔루션이 없음을 알고 있습니다.
> 
> 서비스를 더 잘 구현하고 NL에 더 많은 아이디어를 가져오도록 하기 위해, NL은 [Parkour-Vienna/distrust: Use discourse as an OIDC (OAuth 2.0) provider](https://github.com/Parkour-Vienna/distrust)를 기반으로 사용자가 스스로 신청할 수 있는 Oauth2/OIDC 버전을 구현했습니다.
> 
> ### 설정
> 
> 사용자 관련 데이터를 저장하기 위해 Mysql을 사용하므로, 구체적인 실행 방법은 먼저 Mysql/MariaDB를 설치하고 Sql 스크립트를 실행하여 데이터베이스를 구축한 후, distrust.yml을 구성하여 데이터베이스 관련 내용을 설정하고, 이어서 distrust genkey를 실행하여 해당 rsa 키를 생성하는 것입니다.
> 
> 그 다음 Discourse 백엔드로 가서 [discourse connect](https://meta.discourse.org/t/13045?silent=true) 프로바이더를 생성하고 관련 정보를 입력합니다.
> 
> 이어서 실행합니다
> 
> ```plaintext
> chmod _+x distrust
> ./distrust
> 
> ```
> 
> `IP:3000/apps`를 방문하여 애플리케이션 인터페이스를 확인합니다.
> 
> ### 데모
> 
> ![The image shows a user interface for an Open Authorization 2.0 (OATH2) app dashboard with options to create a new application. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/4/c/a/4ca50d27fe3531bb743be483d97e937e4e42e4d4.png)
> 
> ![A screenshot of the OAuth2 application creation form with fields for application name, description, redirect URLs, allowed groups, and denied groups. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/1/8/7/187631cfc3f09396471dd9a366bd5872174ca66a.png)
> 
> ![The image shows a successful OAuth2 application creation page with a warning to save the client secret securely. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/2/a/1/2a1df027707cd73feb89ac5c6cc6fb6d3dbcefe2.png)
> 
> ![This image shows a screenshot of a software application interface displaying OAuth2 applications with a single active application named 'Test', along with its client ID, status, and creation date. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/e/9/8/e98dc0cf71d4b85c8a89c17f0dc1929fa12d907f.png)
> 
> 사용자가 Oauth2/OIDC 로그인을 사용할 때.
> 
> ![This image shows an authorization screen where the application named 'frenxodeloc' is requesting to access the user's profile and Discord group memberships via OpenID Connect. (Captioned by AI)](https://global.discourse-cdn.com/meta/original/4X/f/2/1/f217b5927260518a97776e24ced28912b92d240f.png)

이것이 제가 찾던 부분인 것 같지만, 저는 기술적인 지식이 부족하므로 누군가가 이 문제를 살펴볼 때까지 인내심을 갖고 기다리겠습니다 🙂

> [DeepL](https://www.deepl.com/en/translator#zh/en-gb/%E7%84%B6%E5%90%8E%E6%89%A7%E8%A1%8C)을 사용하여 원문을 영어로 번역해 공유합니다.

---

<div class="post-metadata">

### Author: ![DaBai\_LuoBo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dabai_luobo/32/487128_2.png) [@DaBai\_LuoBo](https://meta.discourse.org/u/DaBai_LuoBo)
#### Post date: [6월 20, 2025, 12:21오후 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924/3 "2025-06-20T12:21:31Z")

</div>

훌륭한 시작입니다. 오픈소스 기여에 진심으로 감사드립니다. 정말 대단한 시작이네요. 👏 👏 👏

---

<div class="post-metadata">

### Author: ![whitewaterdeu](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@whitewaterdeu](https://meta.discourse.org/u/whitewaterdeu)
#### Post date: [6월 25, 2025, 7:35오전 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924/4 "2025-06-25T07:35:47Z")

</div>

멋지다!

---

<div class="post-metadata">

### Author: ![la\_panda](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/la_panda/32/547078_2.png) [@la\_panda](https://meta.discourse.org/u/la_panda)
#### Post date: [3월 13, 2026, 6:33오전 UTC](https://meta.discourse.org/t/discourse-oauth2-oidc-provider/370924/5 "2026-03-13T06:33:36Z")

</div>

./distrust

mysql 버전:9.0.1

오류:

FTL 데이터베이스 초기화 실패 error=“데이터베이스 마이그레이션 실패: 고유 인덱스 생성 실패: Error 1064 (42000): SQL 구문에 오류가 있습니다. MySQL 서버 버전에 해당하는 매뉴얼을 확인하여 ‘IF NOT EXISTS idx\_user\_authorizations\_user\_client \n\t\tON user\_authorizations(user’ 근처의 올바른 구문을 사용하세요” at line 1
