Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

sso with jsconnect

betabeta New
edited February 2015 in Vanilla 2.0 - 2.8

jsconnect testurl was successful, and it also works with the user after i place the users credentials in the index.php sample of jsconnect from github.
so now what next to make it work for all my users who are already registered.
Now what next to make it work for all users,
my uniqueid field in the db is user_id, profile picture is picture_id, name is username.

<?php
require_once dirname(__FILE__).'/functions.jsconnect.php';
// 1. Get your client ID and secret here. These must match those in your jsConnect settings.
$clientID = "myclientidwashere";
$secret = "secretkey";
// 2. Grab the current user from your session management system or database here.
$signedIn = true; // this is just a placeholder
// YOUR CODE HERE.

// 3. Fill in the user information in a way that Vanilla can understand.
$user = array();
if ($signedIn) {
// CHANGE THESE FOUR LINES.
$user['uniqueid'] = '123';                                 //placed an id
$user['name'] = 'John PHP';                            //my username
$user['email'] = 'john.php@anonymous.com'; // i tried my email here and it works
$user['photourl'] = '';
}
// 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);
JsSSOString($user, $clientID, $secret,$timestamp);

so please anyone to help with guidance on what to do next?

Comments

  • You need to pull the uniqueid, name, email, and photourl from your software. Populate it and you should be good to go.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • betabeta New
    edited February 2015

    @hgtonight said:
    You need to pull the uniqueid, name, email, and photourl from your software. Populate it and you should be good to go.

    yea thanks, it's how to get them, i populated it with the email,uniqueid and name of one user and it logs every user in with that same credentials, how do i make it in such a way it works for the user who is logged onto the site?

  • I don't know what software you are using for user management. You pull it from that software.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • yea, do i pull it with cookies or sessions?

  • I would contact the SocialScript support forum with your query.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • However you detect whether a user is logged into your main site. Use that same code to validate the user here, and get their info from your system.

  • @hgtonight said:
    I would contact the SocialScript support forum with your query.

    please any update?

  • @beta said:
    please any update?

    If I were you, I would contact SocialScript support with your query.

    Closed source means I can't look at it.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • thanks, i can send a copy to you if you don't mind

  • hgtonighthgtonight MVP
    edited February 2015

    @beta said:
    thanks, i can send a copy to you if you don't mind

    I don't want to look at it.

    • To each their own, but I don't appreciate closed source in general
    • You might not have the right to show me it (depends on the terms set forth in their license)
    • I don't want to support paid software that I am not being paid for

    Please contact Social Script support with your issue.

    I am happy to help you out with any Vanilla issues. :)

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight said:
    I am happy to help you out with any Vanilla issues. :)

    thanks man. I get you.

Sign In or Register to comment.