jsConnect is Vanilla's new single-sign-on library. It enables Vanilla users to authenticate with your site even if your site is on a different domain than your forum.
In order to get jsConnect working you have to do the following:
You need to program a page on your site that gives out information on the currently signed in user. We've provided some client libraries to help you with this. If you choose to use a client library, you can ignore the rest of this documentation as it simply describes what the client library will do.
If you need to program your jsConnect page yourself, and the client libraries will not work for you: The easiest way to get your authentication url going is to download a client library and modify the example page that comes with it. If you want a deeper understanding of what's going on or your site is programmed in a language that we don't provide a client library for then keep reading.
The basic format of the page is as follows:
callback({
"uniqueid": "1234",
"name": "John Doe",
"email": "johndoe@noreply.com",
"photourl": "http://nosite.com/johndoe.png"
});
This might look like a javascript call to you and that's because it is called by javascript to work. Let's go through the parts one by one:
If the user isn't signed in to your site then you should give the following response.
callback({"name": "", "photourl": ""});
The jsConnect plugin is installed just like any plugin in Vanilla. Once you install the plugin you will see a jsConnect menu item in your dashboard. Here is where you add your connections. The add/edit page looks like this:

There are descriptions of each field on the page, but I'll give some additional insight here:
Once you have your connection set up you are ready to go.
Once you have your single sign on setup in test-mode you should now secure the connection on your end. This involves using the client ID and secret to sign the responses sent from your site so that Vanilla knows that it's the right site sending the information. Hopefully you've done this with one of our client libraries. If not then you'll have to do it yourself.
While writing the client code for jsConnect is pretty straightforward, it can be a little bit difficult to secure the connection. Because of this we provide client libraries for four of the more popular languages. All of these libraries are open source and maintained on github:
All of these libraries have one file with all of the library code you'll need and one file that gives an example usage. They also have a readme that tells you which file is which.
| Edited March 21 by Mark |