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.
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.
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”