Plugins
Problem with sso integration

I did not build this myself no. The Develper is from Av Scripts

I did not build this myself no. The Develper is from Av Scripts

Ok thanks i will try and edit these things and report back

No i didnt add anything to if (USER_IS_LOGGED_IN) { ... i am unsure what to add there :/ .. and pointing to the client.php has worked for not logging out of one or the other, so i think that portion is fixed anyway. I just need to figure out what you mean by "You didn't put anything that evaluates to true when the user is logged in ?"

Steve,

Perhaps my latest post will shed some light?

http://codologic.com/forum/index.php?u=/topic/5724/wordpress-sso-integration

>Ok thanks i will try and edit these things and report back >No i didnt add anything to if (USER_IS_LOGGED_IN) { ... i am unsure what to add there :/ .. and pointing to the client.php has worked for not logging out of one or the other, so i think that portion is fixed anyway. I just need to figure out what you mean by "You didn't put anything that evaluates to true when the user is logged in ?" Steve, Perhaps my latest post will shed some light? http://codologic.com/forum/index.php?u=/topic/5724/wordpress-sso-integration

@gmdolfint thanks for that, i tried adding that cookie info to teh client php, but still not working. I might be kinda screwed i guess. Doesnt seem i can get it to work at all unfortunatly smile

@gmdolfint thanks for that, i tried adding that cookie info to teh client php, but still not working. I might be kinda screwed i guess. Doesnt seem i can get it to work at all unfortunatly :(

Steve,

If I understand well after re-reading your posts, I am assuming this part of your code is just until you have sorted things out:

$account['uid'] = gamestimeline; //Your logged in user's userid
$account['name'] = gamestimeline; //Your logged in user's username
$account['mail'] = image1969@gmail.com; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now

Now, I see two things here:

a) Unless you forgot to enclose your values in double quotes in your example, that is a problem... Your code should look like this:

$account['uid'] = 1; //Your logged in user's userid
$account['name'] = "gamestimeline"; //Your logged in user's username
$account['mail'] = "image1969@gmail.com"; //Your logged in user's email id
$account['avatar'] = ''; //not used as of now

Note that the $account['uid'] variable should have an integer as its value because it needs a unique identifier (or primary key) from your website's users database. This does not refer to, let's say a "login" id, if that makes sense.

Now, if your code does look something like the above, and you're testing this using a different login credential, that might be the issue because you're hard coding those variables into the client.php file. Those values should be retrieved from your users DB.

Hopefully this well help you a little?

Steve, If I understand well after re-reading your posts, I am assuming this part of your code is just until you have sorted things out: ```` $account['uid'] = gamestimeline; //Your logged in user's userid $account['name'] = gamestimeline; //Your logged in user's username $account['mail'] = image1969@gmail.com; //Your logged in user's email id $account['avatar'] = ''; //not used as of now ```` Now, I see two things here: a) Unless you forgot to enclose your values in double quotes in your example, *that* is a problem... Your code should look like this: ```` $account['uid'] = 1; //Your logged in user's userid $account['name'] = "gamestimeline"; //Your logged in user's username $account['mail'] = "image1969@gmail.com"; //Your logged in user's email id $account['avatar'] = ''; //not used as of now ```` Note that the ````$account['uid']```` variable should have an integer as its value because it needs a unique identifier (or primary key) from your website's users database. This does not refer to, let's say a "login" id, if that makes sense. Now, if your code does look something like the above, and you're testing this using a different login credential, that might be the issue because you're hard coding those variables into the client.php file. Those values should be retrieved from your users DB. Hopefully this well help you a little?

Well seems that WAS the issue, thanks a ton dude. The only remaining issue i am running into now though is as soon as i navigate to the forum from teh main website, it logs me out of the main site as auto logged into teh forum, if that makes sense lol

Well seems that WAS the issue, thanks a ton dude. The only remaining issue i am running into now though is as soon as i navigate to the forum from teh main website, it logs me out of the main site as auto logged into teh forum, if that makes sense lol

hmmm nope, created another user and stll logs in as the one i add to the client.php. I would think it would be better to have it login whatever user. When i just use all default values in the client.php it makes a user called USERNAME :/

hmmm nope, created another user and stll logs in as the one i add to the client.php. I would think it would be better to have it login whatever user. When i just use all default values in the client.php it makes a user called USERNAME :/

No problem, man.

Yeah, even if you create another user it will log in as the one you added to the client.php file because it's hard coded...

Right now what I'd suggest you doing is (it's a bit kludgy, but you can improve the way you handle this):

a) In your website's login page, right after authentication is successful, create some cookies with the relevant user information that the SSO needs: userID, userName, and userEmail.

b) Then inside the client.php file do something like this in the part where you check the user is logged in:

if(isset($_COOKIE["userID"]) && 
    isset($_COOKIE["userName"]) && 
    isset($_COOKIE["userEmail"])) {

    //assign values to variables
    $account['uid'] = $_COOKIE["userID"]; //logged in user's userid
    $account['name'] = $_COOKIE["userName"]; //logged in user's username
    $account['mail'] = $_COOKIE["userEmail"]; //logged in user's email id
    //$account['avatar'] = ''; //not used as of now
}

This way, every user will login onto the forums as themselves and not under "gamestimeline".

Also, you could set array cookies by using the array notation in the cookie name, and then calling them like so (it'd look more organized, IMO):

$_COOKIE["gamestimeline"]["userID"];
$_COOKIE["gamestimeline"]["userName"];
$_COOKIE["gamestimeline"]["userEmail"];

So your code would look something like this:

if(isset($_COOKIE["gamestimeline"]["userID"]) && 
    isset($_COOKIE["gamestimeline"]["userName"]) && 
    isset($_COOKIE["gamestimeline"]["userEmail"])) {

    //assign values to variables
    $account['uid'] = $_COOKIE["gamestimeline"]["userID"]; //logged in user's userid
    $account['name'] = $_COOKIE["gamestimeline"]["userName"]; //logged in user's username
    $account['mail'] = $_COOKIE["gamestimeline"]["userEmail"]; //logged in user's email id
    //$account['avatar'] = ''; //not used as of now so I'm commenting out
}

Hope this helps.

No problem, man. Yeah, even if you create another user it will log in as the one you added to the client.php file because it's hard coded... Right now what I'd suggest you doing is (it's a bit kludgy, but you can improve the way you handle this): a) In your website's login page, right after authentication is successful, create some cookies with the relevant user information that the SSO needs: userID, userName, and userEmail. b) Then inside the client.php file do something like this in the part where you check the user is logged in: ```` if(isset($_COOKIE["userID"]) && isset($_COOKIE["userName"]) && isset($_COOKIE["userEmail"])) { //assign values to variables $account['uid'] = $_COOKIE["userID"]; //logged in user's userid $account['name'] = $_COOKIE["userName"]; //logged in user's username $account['mail'] = $_COOKIE["userEmail"]; //logged in user's email id //$account['avatar'] = ''; //not used as of now } ```` This way, every user will login onto the forums as themselves and not under "gamestimeline". Also, you could set array cookies by using the array notation in the cookie name, and then calling them like so (it'd look more organized, IMO): ```` $_COOKIE["gamestimeline"]["userID"]; $_COOKIE["gamestimeline"]["userName"]; $_COOKIE["gamestimeline"]["userEmail"]; ```` So your code would look something like this: ```` if(isset($_COOKIE["gamestimeline"]["userID"]) && isset($_COOKIE["gamestimeline"]["userName"]) && isset($_COOKIE["gamestimeline"]["userEmail"])) { //assign values to variables $account['uid'] = $_COOKIE["gamestimeline"]["userID"]; //logged in user's userid $account['name'] = $_COOKIE["gamestimeline"]["userName"]; //logged in user's username $account['mail'] = $_COOKIE["gamestimeline"]["userEmail"]; //logged in user's email id //$account['avatar'] = ''; //not used as of now so I'm commenting out } ```` Hope this helps.
edited Dec 9 '15 at 10:27 pm

Hahha well as much as i appretiate the very detailed explanation, its kind of greek to me lol. I do appretiate the help, i was hoping it was going to be alot easier then what it has been up to now (from what i read in teh docs it seemed simple enough). But i am a complete noob at coding stuff. I may have to just give up for now.

Thanks again though man, your time is much appretiated

Hahha well as much as i appretiate the very detailed explanation, its kind of greek to me lol. I do appretiate the help, i was hoping it was going to be alot easier then what it has been up to now (from what i read in teh docs it seemed simple enough). But i am a complete noob at coding stuff. I may have to just give up for now. Thanks again though man, your time is much appretiated
12
944
28
4
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