# Use Discourse SSO with Mantis Bug Tracker

**URL:** https://meta.discourse.org/t/use-discourse-sso-with-mantis-bug-tracker/69236
**Category:** Administrators
**Tags:** sso, how-to
**Created:** [2 september 2017 om 00:08 UTC](https://meta.discourse.org/t/use-discourse-sso-with-mantis-bug-tracker/69236 "2017-09-02T00:08:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![SXX](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sxx/32/119649_2.png) [@SXX](https://meta.discourse.org/u/SXX)
#### Post date: [2 september 2017 om 00:08 UTC](https://meta.discourse.org/t/use-discourse-sso-with-mantis-bug-tracker/69236/1 "2017-09-02T00:08:00Z")

</div>

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

> [@Use Discourse as an identity provider (SSO, DiscourseConnect)](https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974):
>
> So you want to use Discourse as an identity provider for your own web app? Great! Let’s get started. Enable [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) provider setting Under Discourse admin site settings (/admin/site\_settings) enable setting enable discourse connect provider and add a secret string to discourse connect provider secrets (used to hash SSO payloads). Implement [DiscourseConnect](https://meta.discourse.org/t/13045?silent=true) in your web app: Generate a random [nonce](https://en.wikipedia.org/wiki/Cryptographic_nonce). Let’s call this value NONCE. Save it temporarily so that you can verify it with the …

### Install [Discourse SSO](https://meta.discourse.org/t/13045?silent=true) client script

1. Get script from GitHub:  
[GitHub - ArseniyShestakov/singlefile-discourse-sso-php: Ugly, but working single-file SSO implementation in PHP · GitHub](https://github.com/ArseniyShestakov/singlefile-discourse-sso-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:

```plaintext
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.  
[https://github.com/ArseniyShestakov/MantisDiscourseSSO](https://github.com/ArseniyShestakov/MantisDiscourseSSO)

### Edit config\_inc.php

Several new options need to be added to

```plaintext
        // 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.
