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.

[Solved] How do I get role synchronisation working with jsConnect?

FunratedFunrated New
edited December 2013 in Vanilla 2.0 - 2.8


I have just setup Vanilla which works brilliantly. I want SSL with our site on the same domain but as I was hoping to give different roles to different types of user, I opted for the jsConnect plugin. In the jsConnect documentation at it shows that it is possible to configure jsConnect to synchronise roles;

"roles": "member,administrator", // OPTIONAL. You can configure jsconnect to synchronise roles

Everything else is working perfectly - however the roles are not being taken into account. I cannot see anywhere in the jsConnect configuration screen which allows me to turn this feature on.

Has anyone managed to get this working? If so, please let me know how!

Thanks in advance,




  • Options

    Thanks for that. I'm new here and did try to search for "jsconnect" and "roles" - but obviosuly not well enough!

    However - I still can't get the role synchronisation working. I tried Webkadabra's solution for 2.0.18 Vanilla but that does not work for me - and it prevents users being logged in with jsconnect.

    I also attempted installing a clean install of 2.1b but the installation gives me errors (invalid data type on one of the db insert statements)... so no joy on that front either.

    Is there any other way of doing SSO with role synchronisation that anybody knows of?

  • Options

    I have managed to get this going. If anybody else has the same problems I did, then follow Webkadabra's solution for 2.0.18 Vanilla here:

    The problem I was having is that the RoleIDs (taken from the database table gdn_role) need to be passed as an array - so I set them in the JSON as a comma seperated list of ids and then altered Webkadabra's code just slightly in the InsertForBasic function to;

    $syncRoles = Gdn::Config('Garden.SSO.SyncRoles');
    if($syncRoles ) {
    $RoleIDs = (isset($FormPostValues['Roles']) ? explode(",",$FormPostValues['Roles']) : Gdn::Config('Garden.Registration.DefaultRoles'));
    } else {
    $RoleIDs = Gdn::Config('Garden.Registration.DefaultRoles');

    It is just the bold explode which converts the comma separated string into an array.

    This works perfectly for me now.

Sign In or Register to comment.