Last updated on January 17, 2018
Before writing any script login into your installed vanilla forum, go to addons section , Click on Plugins , in that page you will find Vanilla jsConnect Pugin(or go to http://vanillaforums.org/addons search for Vanilla jsConnect) Enable it, configure the fallowing settings
Client ID : The client ID uniquely identifies the site. You can generate a new ID with the button at the bottom of this page.
Secret : The secret secures the sign in process. Do NOT give the secret out to anyone.
Site Name :Enter a short name for the site. This is displayed the signin buttons.
Authenticate Url : The location of the jsonp formatted authentication data.
Sign In Url :The url that users use to sign in.
Register Url : The url that users go to to register for a new account.
Now go to your CodeIgniter Application , open Tank_Auth Auth Controller(Auth.php) add a new method ,Example vanilla(), Download CodeIgniter-jsConnect library and place it in applications/library folder
function vanilla() { // Enabled $_GET method for Vanilla method parse_str(substr($_SERVER['REQUEST_URI'],strpos($_SERVER['REQUEST_URI'],'?')+1,strlen($_SERVER['REQUEST_URI'])-strpos($_SERVER['REQUEST_URI'],'?')),$_GET); // load jsconnect library $this->load->library('jsconnect'); // set Client ID $client_id = ""; // set Secret id $secret = ""; $vanUser = array(); if ($this->tank_auth->is_logged_in()) { $this->userID = $this->tank_auth->get_user_id(); $this->userName = $this->tank_auth->get_username(); $this->user = $this->users->getUserByID($this->userID); $vanUser['uniqueid'] = $this->userID; $vanUser['name'] = $this->user->username; $vanUser['email'] = $this->user->email; // $vanUser['photourl'] = $this->user->ProfilePicture; } $secure = TRUE; $this->jsconnect->WriteJsConnect($vanUser,$_GET, $client_id, $secret, $secure); }