Using Discourse SSO with Mantis Bug Tracker


(Arseniy Sheatakov) #1

Here is the my basic integration for Mantis bug tracker 1.2.
It’s might work with newer versions, but someone has to test it.

Read the instruction and activate SSO provider in Discourse

Install Discourse SSO client script

  1. Get script from GitHub:
    GitHub - ArseniyShestakov/singlefile-discourse-sso-php: Ugly, but working single-file SSO implementation in PHP
  2. Copy discourse-sso.php into directory with your wiki.
  3. Edit defines on top of file according to your need.
  4. To create database table and test it visit https://your.wiki.domain/discourse-sso.php

You can check SSO_DB_TABLE contents from command line:

mysql -u mantisuser -pPASSWORD mantisdb -e "SELECT * FROM sso_login;"

If everything is fine you’ll see username / email and other information here.

Install MantisDiscourseSSO plugin

Plugin need to be cloned into plugins directory and installed via Mantis interface.

Edit config_inc.php

Several new options need to be added to

        // Enable login through Discourse SSO plugin
        $g_login_method = DISCOURSE_SSO;
	// Disable signup on Mantis
        $g_allow_signup = OFF;
	// Disable password reset by Mantis
        $g_send_reset_password = OFF;
        // Must be changed since default is login_page.php and that page will redirect to Discourse SSO
        $g_logout_redirect_page = 'view_all_bug_page.php';
        // Users are created by SSO plugin with empty email
        $g_allow_blank_email = ON;

If someone need this working with newer Mantis please post about that here and I’ll try to make it compatible with 1.3 and 2.x since it’s shouldn’t be too hard.