HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

My vanilla forums SSO doesnt work, what I'm doing wrong?

I use MySQL to store members/registrations on my website.

I added vanilla forums to the website and I want to make one login page for both vanilla and the blog.

The website is written by PHP and JS. I added SSO plugin and finished all the setting there, also I included php library too from github.

This is the code of my authentication file:

<?php

include_once '../db/db.php';
include_once '../db/functions.php';
require_once '../forums/jsConnectPHP-master/functions.jsconnect.php';



// 1. Get your client ID and secret here. These must match those in your jsConnect settings.
$clientID = "xxxxxx";
$secret = "xxxxxxxx";
// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder

if($_SESSION['id'])
    $signedIn = true;

// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();

if ($signedIn) {
   // CHANGE THESE FOUR LINES.

  $user['uniqueid'] = $_SESSION['id'];
  $user['name'] = $_SESSION['username'];
  $user['email'] = $_SESSION['email'];  

}

// 4. Generate the jsConnect string.

// This should be true unless you are testing. 
// You can also use a hash name like md5, sha1 etc which must be the name as the connection settings in Vanilla.
$secure = true; 

WriteJsConnect($user, $_GET, $clientID, $secret, $secure);

exit();

?>

And this code for my login page: check the attached file

My problem is: when I login into the page on the blog it works but at the forums is still "logged out"!

Comments

  • Anyone around? I'm trying with vanilla forum from a week, and I still couldn't make it work?

  • Don't forget to access your forum via vanilla.example.com/sso

    Also, go to the vanilla.example.com/settings/jsconnectv ...

    Test your Url. Share the error you get.



Sign In or Register to comment.