Expand my Community achievements bar.

Creating rooms from flex

Avatar

Former Community Member
Is there a way to create rooms from a flex app?

I can't give my client a login & pw for
cocomo.acrobat.com. He wants to create his room via a flex app...



is this possible??

I thought: if the AIR application can manage the rooms, the
API must exists, no?
4 Replies

Avatar

Former Community Member


Hi dilbertje,



The short answer is that you can create rooms from a client
side app.



The long answer is that we really don't want you creating
rooms from a client side app. I think you touch on the issue in
your message - you don't want to give your client your own login
and password so that they can do it themselves. Essentially, if you
gave them a Flex app that could create new rooms, you'd have to
embed your username and password in that application, and *anyone*
who had access to that client app could use that to steal your
password and own your account.



In general, the safe way to proceed is to do these
operations from server-to-server. If you need to give your client
an app that creates new rooms on the fly, have them login to your
server in some way, and have any request for a new room go through
your server. From there, you can be sure that the user is who they
say they are, and login from your server into Cocomo (using your
username and password), and create a new room via the HTTP/REST
APIs. This way, the only entity logging into your account is your
own server. This is a fairly standard pattern in using webservices,
and the safest way to proceed.



If you'd like to know more about the HTTP/REST APIs for room
provisioning, have a look at /extras/scripts in the SDK package,
which contains utility classes and samples for using the APIs in
various languages (even Google App Engine is included in the python
example, if you don't want to set up your own server).



hope this helps

nigel

Avatar

Former Community Member
Nigel, thank you for the reply.

Indeed, currently I'm using a flex front-end who posts data
back to a php file which creates the room for me. The room is
created, but I still get the follow error:

Warning: stream_get_contents()
[function.stream-get-contents]: SSL: fatal protocol error in
/home/madebythem/domains/madebythem.be/public_html/cocomo/cocomo.php
on line 448



Warning: stream_get_contents()
[function.stream-get-contents]: SSL: fatal protocol error in
/home/madebythem/domains/madebythem.be/public_html/cocomo/cocomo.php
on line 532



Warning: stream_get_contents()
[function.stream-get-contents]: SSL: fatal protocol error in
/home/madebythem/domains/madebythem.be/public_html/cocomo/cocomo.php
on line 448



Warning: stream_get_contents()
[function.stream-get-contents]: SSL: fatal protocol error in
/home/madebythem/domains/madebythem.be/public_html/cocomo/cocomo.php
on line 532



Warning: stream_get_contents()
[function.stream-get-contents]: SSL: fatal protocol error in
/home/madebythem/domains/madebythem.be/public_html/cocomo/cocomo.php
on line 448





my code:



$account = "mariovde";

$devuser = "mariovde@telenet.be";

$devpass = "dilbertje";

$secret = "07dd6e342c164135be59f29fbc444931";



$host = "
http://connectnow.acrobat.com";

$accountURL = "{$host}/{$account}";





session_start();

$roomName = $_POST['nameofroom'];

echo "creating room : {$roomName}";

$pc_account = new CocomoAccount($accountURL);

$pc_account->login($devuser, $devpass);

$pc_account->createRoom($roomName);



$session = $pc_account->getSession($roomName);

$roomURL = "{$accountURL}/{$roomName}";

$token = $session->getAuthenticationToken($secret, $user,
$user, $role);

echo "Room created";



Avatar

Employee
Are you saying that everything works but you are seeing the
warning messages or that something doesn't work ?



I did a search for the warning and in most of the posts it
says it's just a... warning :)



There is some mention of particular versions of PHP. What
version are you using ?



Also, there is some mention of this error when accessing an
IIS server but this is not the case because we don't use IIS.



If you have any problem, please let us know, otherwise you
can try to updated to the latest PHP module, or configure PHP to
don't display the warning.



I verified with PHP 5.2.6 and I am not getting any
error/warning.

Avatar

Former Community Member
What I'm saying is that everything works but I'm seeing the
warning messages...

Offcourse I know it's just a warning, but what I need to know
is why :). SSL is enabled on my server...so. But hey, it works!

I'm currently using PHP Version 5.2.3.