Plugins
SSO and code Igniter?
sso

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

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&#039;t be able to test my logout, but I have not reason not to expect it won&#039;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( &quot;client_id&quot; =&amp;gt; &#039;&amp;lt;SECRET&amp;gt;&#039;, &quot;secret&quot; =&amp;gt; &#039;&amp;lt;SECRET&amp;gt;&#039;, &quot;timeout&quot; =&amp;gt; 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-&amp;gt;session-&amp;gt;userdata(&quot;login&quot;)) { $account[&#039;uid&#039;] = &amp;lt;This is the userID from MY WEBSITES DATABASE&amp;gt; //Your logged in user&#039;s userid $account[&#039;name&#039;] = &amp;lt;User Name&amp;gt;//Your logged in user&#039;s username $account[&#039;mail&#039;] = &amp;lt;I have the actual email here NOT the email ID...is that going to be a problem&amp;gt;//Your logged in user&#039;s email id $account[&#039;avatar&#039;] = &#039;&#039;; //not used as of now } //print_r($account); $sso-&amp;gt;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&#039;s API. If you see anything I am missing please help. Thanks for making an awesome forum software. Sincerely, BAT

By the way:
When I try to manually invoke the client script from the url, I get this error. (I am assuming it is because I don't have a properly formed json request)

A PHP Error was encountered

Severity: Notice

Message: Undefined index: timestamp

Filename: SSO/SSO.php

Line Number: 64

Backtrace:

File: /home/bradtowle/public_html/PlayerTracker/SSO/SSO.php
Line: 64
Function: _error_handler

File: /home/bradtowle/public_html/PlayerTracker/application/controllers/Pt.php
Line: 336
Function: output_jsonp

File: /home/bradtowle/public_html/PlayerTracker/index.php
Line: 294
Function: require_once

Don't know if that helps. (Also I renamed the file sso.php to SSO.php would that be causing a problem?)

By the way: When I try to manually invoke the client script from the url, I get this error. (I am assuming it is because I don&#039;t have a properly formed json request) ```` A PHP Error was encountered Severity: Notice Message: Undefined index: timestamp Filename: SSO/SSO.php Line Number: 64 Backtrace: File: /home/bradtowle/public_html/PlayerTracker/SSO/SSO.php Line: 64 Function: _error_handler File: /home/bradtowle/public_html/PlayerTracker/application/controllers/Pt.php Line: 336 Function: output_jsonp File: /home/bradtowle/public_html/PlayerTracker/index.php Line: 294 Function: require_once ```` Don&#039;t know if that helps. (Also I renamed the file sso.php to SSO.php would that be causing a problem?)

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

What do you mean by plain text email ?

&amp;gt;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 What do you mean by plain text email ?

I have the actual email not an 'id'

I have the actual email not an &#039;id&#039;
edited Oct 21 '15 at 4:03 am

Hi

By actual email, do you mean xyz@abc.com ?

It should have worked.

Can you provide us your forum address ? We will test it.

Hi By actual email, do you mean xyz@abc.com ? It should have worked. Can you provide us your forum address ? We will test it.

Yes, I have the actual email in the form.
The address is here:
http://www.carpenoctemcoding.com/codoforum/

My site isn't really production ready at the moment but I wanted to get the integration done first.

Thanks,

BAT

Yes, I have the actual email in the form. The address is here: http://www.carpenoctemcoding.com/codoforum/ My site isn&#039;t really production ready at the moment but I wanted to get the integration done first. Thanks, BAT

Okay, wow. Silly mistake.
I thought userId was the id from the database table. I simply sent the user name (login) for both the userID and the username and it worked.

I apologize. Thanks for the support, it is working now.

BAT

Okay, wow. Silly mistake. I thought userId was the id from the database table. I simply sent the user name (login) for both the userID and the username and it worked. I apologize. Thanks for the support, it is working now. BAT
1.41k
6
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft