הפוך את ה-Discourse שלך ל-Provider של Oauth2/OIDC

סיכום מבוסס בינה מלאכותית

cuo_wu introduced a custom plugin allowing Discourse to function as an OAuth2/OIDC Provider, enabling users to create their own applications. This solution builds upon the Parkour-Vienna/distrust project to fill a gap in official Discourse features. The setup requires a MySQL/MariaDB database, configuration of distrust.yml, RSA key generation, and linking the provider in the Discourse admin panel. Once running on port 3000, users can access an interface to manage apps, view client secrets, and authorize logins. satonotdead shared an English translation of the post, noting their lack of technical expertise but interest in the tool. DaBai_LuoBo and whitewaterdeu praised the open-source contribution. However, la_panda reported a critical error when attempting to run the script with MySQL version 9.0.1, specifically a SQL syntax failure during database migration regarding unique index creation (Error 1064), indicating a potential compatibility issue with newer MySQL versions.

:information_source: Summary Oauth2/OIDC Provider. Users can create their own apps.
:hammer_and_wrench: Download Link https://vvpp.cc/s/GPmCV

Features

We know that Discourse officially does not use Discourse as a solution for an Oauth2/OIDC Provider.

To better implement the service and to allow everyone to bring more creativity into NL, NL has implemented an Oauth2/OIDC Provider based on Parkour-Vienna/distrust: Use discourse as an OIDC (OAuth 2.0) provider, which allows users to apply for applications themselves.

Configuration

I used Mysql to store user-related data, so the specific usage method is to first install Mysql/MariaDB, execute the Sql script to create the database; then configure distrust.yml, set the database-related content, and then execute distrust genkey to generate the corresponding rsa key; then create a discourse connect provider in the Discourse backend and enter the relevant information.

Then execute

chmod _+x distrust
./distrust

Access your IP:3000/apps to see the application interface.

Demo

When user use Oauth2/OIDC login.

5 לייקים

This seems to be the piece I was looking for but I’m not technical, so I will patiently wait until someone looks into it :slight_smile:

I’m sharing the OP translated to english with DeepL.

לייק 1

An excellent beginning; I am grateful for your open-source contribution. This truly marks a magnificent commencement. :clap: :clap: :clap:

מגניב!

./distrust

mysql version:9.0.1

error:

FTL failed to initialize database error=“failed to migrate database: failed to create unique index: Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘IF NOT EXISTS idx_user_authorizations_user_client \n\t\tON user_authorizations(user’ at line 1”