jsConnect doesn't register new account when "registration" set to "connect"
For the website I'm working on, admins need to be able to create articles etc, when doing so a new thread needs to be created on our Vanilla Forums setup. On the articles page there'll be a link to the created forum thread, on which logged in and approved users (on the main site) can comment. I decided to use jsConnect since we don't want users to have to create a separate forum account. I've used the provided example to write a simple script to return the correct information when a user is logged in and approved;
$frontBridge = new Frontbridge();
$clientId = '';
$clientSecret = '';
$user = [];
session_start();
if ($frontBridge->isLoggedIn()) {
$loggedInUser = $frontBridge->getLoggedInUser();
if ($loggedInUser->isApproved()) {
$user['uniqueid'] = $loggedInUser->getUniqueId();
$user['name'] = $loggedInUser->getFullName();
$user['email'] = $loggedInUser->getMailAddress();
$user['photourl'] = $loggedInUser->getImage()->getUrl();
}
}
$secure = true;
writeJsConnect($user, $_GET, $clientId, $clientSecret, $secure);
In the admin dashboard I've checked both "This is trusted connection and can sync roles & permissions" and "Make this connection your default signin method", and the script works when I've set the "registrations" setting to "approval", it even creates a forum member when one doesn't exist yet. We don't want users to be able to register at all on the forum though, but when I set the "registration" setting to "connect" (which should only allow account creation through SSO), no account is created an I instead get the error "user with id [x] not found". Any idea how this issue can be solved?
Using Vanilla version 3.3
Comments
I instead get the error "user with id [x] not found".
I can not find where this error could come from. Could you provide a screenshot?
My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations
VanillaSkins.com - Plugins, Themes and Graphics for Vanillaforums OS
The problem seemed to be me not passing through a default role from my authorization script. Maybe I missed it in the documentation, but it's extremely unclear this is necessary for the Connect registration type to work.