I am trying to integrate corundum into an existing web-application written with Code Igniter.
I believe I have figured out how to integrate the files together. (My controller is importing the sso.php).
When I go to login on Codoforum it takes me to my login (check). I haven't be able to test my logout, but I have not reason not to expect it won't work.
The problem is once I login at my sight it redirects me back to the codoforum as suggested by the directions. However, I am still not logged in.
1) Will codoforum accept user accounts that have already been created?
2) I put the client.php inside a public function for my class controller. I know it is getting invoked because it is set as my SSO Get User Path:
3) I noticed it said email_ID, I only have a plain text email stored in the user table. Is there going to be a problem if send it the actual email in client.php
Here is my client.php (placed inside a function)
public function CODO_getUser()
{
/**
*
* The SSO client id and secret MUST be same as that set in the Codoforum
* SSO plugin settings
*/
$settings = array(
"client_id" => '<SECRET>',
"secret" => '<SECRET>',
"timeout" => 6000
);
$sso = new codoforum_sso($settings);
$account = array();
/**
*
* Here comes your logic to check if the user is logged in or not.
* A simple example would be using PHP SESSION
*/
if ($this->session->userdata("login")) {
$account['uid'] = <This is the userID from MY WEBSITES DATABASE> //Your logged in user's userid
$account['name'] = <User Name>//Your logged in user's username
$account['mail'] = <I have the actual email here NOT the email ID...is that going to be a problem>//Your logged in user's email id
$account['avatar'] = ''; //not used as of now
}
//print_r($account);
$sso->output_jsonp($account); //output above as JSON back to Codoforum
exit();
}
I have gone through the directions stated here: https://codoforum.com/documentation/implementing-codoforum-sso
By the way nice tutorial it was much easier to understand than google's API.
If you see anything I am missing please help.
Thanks for making an awesome forum software.
Sincerely,
BAT