401 Session xxyyzz not found
I've set up my Working BBB about two weeks ago and a second one integrated in Moodle. Now I try to code my own little Joining-Tool for my custom requirements. Used the "Full Usage Sample" to code my first example and direct join works well but with setRedirect(false) the URL with the sessionToken doesn't work: "401, not allowed, Session xxyyzz not found"
My Code (with modifyed URLs and Secret):
error_reporting(E_ALL);
ini_set('display_errors', 1);
$Username = "MyName";
$meetingId = "SuperMeeting1234";
$meetingName = "Welcome Meeting!";
$usertype="moderator"; # moderator/attendee
$passwords = array('moderator' => 'MyHiSecModPW', # Moderator-Passwort
'attendee' => 'MyHiSecAtPw'); # Teilnehmer-Passwort
putenv("BBB_SECRET=SessionKeyFromMyBBBServer");
putenv("BBB_SERVER_BASE_URL=https://bbb.myserver.com/bigbluebutton/");
require_once 'bbb-api/vendor/autoload.php';
use BigBlueButton\BigBlueButton;
use BigBlueButton\Parameters\CreateMeetingParameters;
use BigBlueButton\Parameters\JoinMeetingParameters;
// Init BigBlueButton API
$bbb = new BigBlueButton();
// Create the meeting
$createParams = new CreateMeetingParameters($meetingId, $meetingName);
$createParams = $createParams->setModeratorPassword($passwords['moderator'])
->setAttendeePassword($passwords['attendee']);
$bbb->createMeeting($createParams);
// Send a join meeting request
$joinParams = new JoinMeetingParameters($meetingId, $Username, $passwords[$usertype]);
// Ask for immediate redirection
// $joinParams->setRedirect(true);
// echo $bbb->getJoinMeetingURL($joinParams);
// Let the prorgrammer do the redirection later
$joinParams->setRedirect(false);
$joinResponse = $bbb->joinMeeting($joinParams);
// Prepare the server URL
$bbbServerUrl = "https://bbb.myserver.com";
echo '<br>Join-Link: <a target="_blank" href="'.$bbbServerUrl . '/html5client/join?sessionToken=' . $joinResponse->getSessionToken() . '">LinkiWinki</a>';
I have the same problem. Any solution?
I found no better solution yet, except taking the Direct-Join URL
echo $bbb->getJoinMeetingURL($joinParams);
wich in my opinion is a very "unsexy" solution, because of some unencrypted Information in it.
Found this ~1 year old bug: https://github.com/bigbluebutton/bigbluebutton-api-php/issues/34#issuecomment-481641204 tried to put this "JSESSIONID" in any possible way in to a cookie but no luck, always the same error ... (so ... seems to another problem this time)
hope we'll get an answer and solution soon
I also was looking for another solution and had found this repo -- https://github.com/DevinY/bbb-php-api
It works normal but the code is written not so good.
It related to this configuration
https://github.com/bigbluebutton/bigbluebutton/blob/41f19a2cd1bc7dae76cbd805cdc3ddfbf1e6ab18/bigbluebutton-web/grails-app/conf/bigbluebutton.properties#L235
If you set your BigBlueButton server configuration value allowRequestsWithoutSession pt true it will work.
We have a code for JSESSIONID in the repository but might needs fixing.
Response in https://github.com/bigbluebutton/bigbluebutton-api-php/issues/34#issuecomment-870562372