Hi,
I'm using the recent php sdk to create a room and generate auth tokens.
Every time the user tries to login we run the following php code:
try {
$rtc->createRoom($room, $template, true);
$collection = 'UserManager';
$rtc->subscribeCollection($room, $collection);
} catch (Exception $e) {
// room already exists?
log($e);
}
$session = $rtc->getSession($room);
$token = $session->getAuthenticationToken($secret, $userName, $userId, $userRole);
Transient room which prevents duplicate IDs:
I'm getting the login event and the logout event immediately after that, both in the flash client and from the LCCS server2server hooks.
In the php try/catch block I'm getting: exception 'RTCError' with message '403' in lccs.php:889
Sometimes the room is destroyed and sometimes not but the user still can't login after less than 5 minutes.
Non-transient room which allows duplicate IDs:
Any idea what could be wrong?
Thanks
Views
Replies
Total Likes
Not really sure of what you mean by "Non-transient room which allows duplicate IDs: When a user logs out, the room sometimes disappears". How do you know the room has disappeared ? Did you check in the Developer Portal and it's not there anymore ?
Regarding the 403, that's an authentication error. I am wondering if your authentication token (in AccountManager in the PHP code) becomes invalid.
Basically the authentication session on the server-side has an inactivity timeout of 15 minutes, so if you don't access our services for 15 minutes the authentication token expires and you'll start getting 403.
There are a couple of options here:
1) if you can set up an interval timer or cron-job like task (don't know if it's possible in PHP) you can "ping" our server every 10 minutes and keep the token alive.
2) if you get a 403 you should login again and retry the operation.
Views
Replies
Total Likes
Yes, I checked in the room console and the room is not there. $lccs->getRoomInfo($roomName) also shows that the room is not there.
Every time the user tries to login, either on the first time or after he loged out, I'm authenticating, trying to create the room and generating a token:
$rtc = new RTCAccount($accountURL);
$rtc->login($account, $pass);
try {
$rtc->createRoom($room, $template, true);
$collection = 'UserManager';
$rtc->subscribeCollection($room, $collection);
} catch (Exception $e) {
// room already exists?
log($e);
}
$session = $rtc->getSession($room);
$token = $session->getAuthenticationToken($secret, $userName, $userId, $userRole);
I can save the lccs session in cache and use a cron-job to ping your server but I don't understand why the above doesn't work.
Currently in dev I only have one php request that authenticate and talk to lccs.
If on the future I'll have several concurrent requests, is it possible that one request will invalidate the lccs session of another request when it authenticates?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies