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.

Embedded SSO with jsConnect

juworldjuworld New
edited April 2014 in Vanilla 2.0 - 2.8

Hi Guys,

New to Vanilla and is loving it!

I'm trying to figure out how to embed vanilla forum using embedded SSO with jsConnected. I have been following

My javascript is throwing some weird errors.
Uncaught TypeError: Cannot read property 'appendChild' of null from embed.js

try { if (window.location.hash.substr(0, 6) != "#poll:") window.vanilla.embed(); } catch(e) { var error = document.createElement('div'); = "10px"; = "12px"; = "lucida grande"; = "#ffffff"; = "#000000"; error.appendChild(document.createTextNode("Failed to embed Vanilla: " + e)); (document.getElementById('vanilla-comments')).appendChild(error); // this is where the error happens }
I think it is because I'm not configuring it correctly. I'd just like to confirm my javascript variables are set correctly. They are:
var vanilla_forum_url = "http://dukeim.tln.lh/resources/vanilla/" // The full http that poins to index.php? var vanilla_identifier = "1"; // I'm not sure what this is... I can't seem to find this anywhere in the dashboard... var vanilla_sso = "<?php echo JsSSOString($User, $client_id, $Secret,); ?>" ; // I am using the JsSSOString php function. But, I'm not sure if I'm building this correctly... how do i test?

Please advice!



vanilla version: vanilla-core-2-0-18-10



  • Options
    juworldjuworld New
    edited April 2014

    K, This is dumb. All I need is to define a div tag with an id set to vanilla-comments

    <div id="vanilla-comments"></div>

    Now for the variables:
    var vanilla_forum_url = ""; // The full http url & path to your vanilla forum var vanilla_identifier = 'MyCustomCodeName'; // Your unique identifier (can be anything) for the content being commented on

    But, it'll be great if someone could help me with the SSO. I'm still having trouble building it...

  • Options

    K, sso issues solved by referring to

    The key is to make sure the user object is in the right order
    1. email
    2. name
    3. photourl
    4. uniqueid
    5. client_id

  • Options
    hgtonighthgtonight ∞ · New MVP

    Welcome to the community!

    I just wanted to thank you for posting back with your solutions. I am sure it will help someone else in the future. :)

    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.

Sign In or Register to comment.