You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openmeetings.apache.org by 由超 <yo...@rimag.com.cn> on 2017/03/14 09:34:19 UTC
OM php API gave me invalid Hash
Hello, all:
I am using the PHP API to create room. The last step generates a URL I can use. When I went to the URL, "Invalid Hash" pops up. If I login, I can see the room is successfully created. OM version 3.2. If I use the swf way, the URL asked me to type in username and password.
Thanks for any help.
=============
$gateway = new OmGateway(getOmConfig());
if ($gateway->login()) {
// do some logic gere
$room_id = $gateway->updateRoom(getRoom());
$options = array('roomId' => $room_id,'moderated' => true,'allowRecording' => true);
$user = $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
print_r($user);
$HashValue = $gateway->getSecureHash($user,$options);
echo $room_id . "\n";
echo $HashValue . "\n";
echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue . "&scopeRoomId=" . $room_id . "&language=1";
echo "\n";
//$url = 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue . "&scopeRoomId=" . $room_id . "&language=" . '11';
//echo 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue . '&language=11';
//header("Location:$url");
} else {
// notify user on bad config
echo 'bad user config';
}
=================
Re: Re: OM php API gave me invalid Hash
Posted by Maxim Solodovnik <so...@gmail.com>.
Invitation hashes were designed to be used by users from room (send invitation)
From PHP secure hash should be used
On Wed, Mar 15, 2017 at 11:25 AM, 由超 <yo...@rimag.com.cn> wrote:
> That make sense.
>
> Another question, after I create the room, I have to use the
> getInvitationHash to get another hash for other user to access the room. Is
> that correct?
>
>
>
>
> 在 2017-03-15 11:49:18,"Maxim Solodovnik" <so...@gmail.com> 写道:
>>OK, i found the issue
>>
>>you are using wrong URL :) (sorry forgot about this change)
>>for 3.1.x you need
>> echo $gateway->getUrl() . "/hash?&secureHash=" . $HashValue .
>>"&scopeRoomId=" . $room_id . "&language=1";
>>for 3.2.x you need
>> echo $gateway->getUrl() . "/hash?&secure=" . $HashValue . "&language=1";
>>
>>On Wed, Mar 15, 2017 at 9:55 AM, 由超 <yo...@rimag.com.cn> wrote:
>>> I installed 3.1.6 again. Using the same code, I can enter the conference
>>> room now. The 3.2.0 has the invalid hash problem. Maybe there is a bug in
>>> 3.2.0 or in the PHP API.
>>>
>>>
>>>
>>>
>>>
>>> 在 2017-03-14 18:37:55,"Maxim Solodovnik" <so...@gmail.com> 写道:
>>>>Hello,
>>>>
>>>>hash created is "one time hash" maybe it was somehow already used? for
>>>>example hidden redirect happens?
>>>>
>>>>On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
>>>>> Hello, all:
>>>>>
>>>>> I am using the PHP API to create room. The last step generates a URL I
>>>>> can
>>>>> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can
>>>>> see
>>>>> the room is successfully created. OM version 3.2. If I use the swf way,
>>>>> the
>>>>> URL asked me to type in username and password.
>>>>>
>>>>> Thanks for any help.
>>>>>
>>>>>
>>>>> =============
>>>>> $gateway = new OmGateway(getOmConfig());
>>>>> if ($gateway->login()) {
>>>>> // do some logic gere
>>>>> $room_id = $gateway->updateRoom(getRoom());
>>>>> $options = array('roomId' => $room_id,'moderated' =>
>>>>> true,'allowRecording' => true);
>>>>> $user =
>>>>>
>>>>>
>>>>> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
>>>>> print_r($user);
>>>>> $HashValue = $gateway->getSecureHash($user,$options);
>>>>> echo $room_id . "\n";
>>>>> echo $HashValue . "\n";
>>>>> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
>>>>> "&scopeRoomId=" . $room_id . "&language=1";
>>>>> echo "\n";
>>>>> //$url =
>>>>> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" .
>>>>> $HashValue
>>>>> .
>>>>> "&scopeRoomId=" . $room_id . "&language=" . '11';
>>>>> //echo
>>>>> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
>>>>> '&language=11';
>>>>> //header("Location:$url");
>>>>> } else {
>>>>> // notify user on bad config
>>>>> echo 'bad user config';
>>>>> }
>>>>> =================
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>WBR
>>>>Maxim aka solomax
>>
>>
>>
>>--
>>WBR
>>Maxim aka solomax
--
WBR
Maxim aka solomax
Re:Re: OM php API gave me invalid Hash
Posted by 由超 <yo...@rimag.com.cn>.
That make sense.
Another question, after I create the room, I have to use the getInvitationHash to get another hash for other user to access the room. Is that correct?
在 2017-03-15 11:49:18,"Maxim Solodovnik" <so...@gmail.com> 写道:
>OK, i found the issue
>
>you are using wrong URL :) (sorry forgot about this change)
>for 3.1.x you need
> echo $gateway->getUrl() . "/hash?&secureHash=" . $HashValue .
>"&scopeRoomId=" . $room_id . "&language=1";
>for 3.2.x you need
> echo $gateway->getUrl() . "/hash?&secure=" . $HashValue . "&language=1";
>
>On Wed, Mar 15, 2017 at 9:55 AM, 由超 <yo...@rimag.com.cn> wrote:
>> I installed 3.1.6 again. Using the same code, I can enter the conference
>> room now. The 3.2.0 has the invalid hash problem. Maybe there is a bug in
>> 3.2.0 or in the PHP API.
>>
>>
>>
>>
>>
>> 在 2017-03-14 18:37:55,"Maxim Solodovnik" <so...@gmail.com> 写道:
>>>Hello,
>>>
>>>hash created is "one time hash" maybe it was somehow already used? for
>>>example hidden redirect happens?
>>>
>>>On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
>>>> Hello, all:
>>>>
>>>> I am using the PHP API to create room. The last step generates a URL I
>>>> can
>>>> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can
>>>> see
>>>> the room is successfully created. OM version 3.2. If I use the swf way,
>>>> the
>>>> URL asked me to type in username and password.
>>>>
>>>> Thanks for any help.
>>>>
>>>>
>>>> =============
>>>> $gateway = new OmGateway(getOmConfig());
>>>> if ($gateway->login()) {
>>>> // do some logic gere
>>>> $room_id = $gateway->updateRoom(getRoom());
>>>> $options = array('roomId' => $room_id,'moderated' =>
>>>> true,'allowRecording' => true);
>>>> $user =
>>>>
>>>> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
>>>> print_r($user);
>>>> $HashValue = $gateway->getSecureHash($user,$options);
>>>> echo $room_id . "\n";
>>>> echo $HashValue . "\n";
>>>> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
>>>> "&scopeRoomId=" . $room_id . "&language=1";
>>>> echo "\n";
>>>> //$url =
>>>> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue
>>>> .
>>>> "&scopeRoomId=" . $room_id . "&language=" . '11';
>>>> //echo
>>>> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
>>>> '&language=11';
>>>> //header("Location:$url");
>>>> } else {
>>>> // notify user on bad config
>>>> echo 'bad user config';
>>>> }
>>>> =================
>>>>
>>>
>>>
>>>
>>>--
>>>WBR
>>>Maxim aka solomax
>
>
>
>--
>WBR
>Maxim aka solomax
Re: OM php API gave me invalid Hash
Posted by Maxim Solodovnik <so...@gmail.com>.
OK, i found the issue
you are using wrong URL :) (sorry forgot about this change)
for 3.1.x you need
echo $gateway->getUrl() . "/hash?&secureHash=" . $HashValue .
"&scopeRoomId=" . $room_id . "&language=1";
for 3.2.x you need
echo $gateway->getUrl() . "/hash?&secure=" . $HashValue . "&language=1";
On Wed, Mar 15, 2017 at 9:55 AM, 由超 <yo...@rimag.com.cn> wrote:
> I installed 3.1.6 again. Using the same code, I can enter the conference
> room now. The 3.2.0 has the invalid hash problem. Maybe there is a bug in
> 3.2.0 or in the PHP API.
>
>
>
>
>
> 在 2017-03-14 18:37:55,"Maxim Solodovnik" <so...@gmail.com> 写道:
>>Hello,
>>
>>hash created is "one time hash" maybe it was somehow already used? for
>>example hidden redirect happens?
>>
>>On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
>>> Hello, all:
>>>
>>> I am using the PHP API to create room. The last step generates a URL I
>>> can
>>> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can
>>> see
>>> the room is successfully created. OM version 3.2. If I use the swf way,
>>> the
>>> URL asked me to type in username and password.
>>>
>>> Thanks for any help.
>>>
>>>
>>> =============
>>> $gateway = new OmGateway(getOmConfig());
>>> if ($gateway->login()) {
>>> // do some logic gere
>>> $room_id = $gateway->updateRoom(getRoom());
>>> $options = array('roomId' => $room_id,'moderated' =>
>>> true,'allowRecording' => true);
>>> $user =
>>>
>>> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
>>> print_r($user);
>>> $HashValue = $gateway->getSecureHash($user,$options);
>>> echo $room_id . "\n";
>>> echo $HashValue . "\n";
>>> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
>>> "&scopeRoomId=" . $room_id . "&language=1";
>>> echo "\n";
>>> //$url =
>>> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue
>>> .
>>> "&scopeRoomId=" . $room_id . "&language=" . '11';
>>> //echo
>>> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
>>> '&language=11';
>>> //header("Location:$url");
>>> } else {
>>> // notify user on bad config
>>> echo 'bad user config';
>>> }
>>> =================
>>>
>>
>>
>>
>>--
>>WBR
>>Maxim aka solomax
--
WBR
Maxim aka solomax
Re: OM php API gave me invalid Hash
Posted by 由超 <yo...@rimag.com.cn>.
I installed 3.1.6 again. Using the same code, I can enter the conference room now. The 3.2.0 has the invalid hash problem. Maybe there is a bug in 3.2.0 or in the PHP API.
在 2017-03-14 18:37:55,"Maxim Solodovnik" <so...@gmail.com> 写道:
>Hello,
>
>hash created is "one time hash" maybe it was somehow already used? for
>example hidden redirect happens?
>
>On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
>> Hello, all:
>>
>> I am using the PHP API to create room. The last step generates a URL I can
>> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can see
>> the room is successfully created. OM version 3.2. If I use the swf way, the
>> URL asked me to type in username and password.
>>
>> Thanks for any help.
>>
>>
>> =============
>> $gateway = new OmGateway(getOmConfig());
>> if ($gateway->login()) {
>> // do some logic gere
>> $room_id = $gateway->updateRoom(getRoom());
>> $options = array('roomId' => $room_id,'moderated' =>
>> true,'allowRecording' => true);
>> $user =
>> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
>> print_r($user);
>> $HashValue = $gateway->getSecureHash($user,$options);
>> echo $room_id . "\n";
>> echo $HashValue . "\n";
>> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
>> "&scopeRoomId=" . $room_id . "&language=1";
>> echo "\n";
>> //$url =
>> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue .
>> "&scopeRoomId=" . $room_id . "&language=" . '11';
>> //echo
>> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
>> '&language=11';
>> //header("Location:$url");
>> } else {
>> // notify user on bad config
>> echo 'bad user config';
>> }
>> =================
>>
>
>
>
>--
>WBR
>Maxim aka solomax
Re: OM php API gave me invalid Hash
Posted by 由超 <yo...@rimag.com.cn>.
Thanks for your time.
I printed the URL right after I get the Hash. There is no other user access the link yet. I created the room as a public room. The intention is to let other users (not registered nor signed on user) to access the room without having an account on the server. The following is the code I used.
$HashValue = $gateway->getSecureHash($user, $options);
echo $gateway->getUrl() . "/hash?&secureHash=" . $HashValue . "&scopeRoomId=" . $room_id . "&language=1";
在 2017-03-14 18:37:55,"Maxim Solodovnik" <so...@gmail.com> 写道:
>Hello,
>
>hash created is "one time hash" maybe it was somehow already used? for
>example hidden redirect happens?
>
>On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
>> Hello, all:
>>
>> I am using the PHP API to create room. The last step generates a URL I can
>> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can see
>> the room is successfully created. OM version 3.2. If I use the swf way, the
>> URL asked me to type in username and password.
>>
>> Thanks for any help.
>>
>>
>> =============
>> $gateway = new OmGateway(getOmConfig());
>> if ($gateway->login()) {
>> // do some logic gere
>> $room_id = $gateway->updateRoom(getRoom());
>> $options = array('roomId' => $room_id,'moderated' =>
>> true,'allowRecording' => true);
>> $user =
>> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
>> print_r($user);
>> $HashValue = $gateway->getSecureHash($user,$options);
>> echo $room_id . "\n";
>> echo $HashValue . "\n";
>> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
>> "&scopeRoomId=" . $room_id . "&language=1";
>> echo "\n";
>> //$url =
>> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue .
>> "&scopeRoomId=" . $room_id . "&language=" . '11';
>> //echo
>> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
>> '&language=11';
>> //header("Location:$url");
>> } else {
>> // notify user on bad config
>> echo 'bad user config';
>> }
>> =================
>>
>
>
>
>--
>WBR
>Maxim aka solomax
Re: OM php API gave me invalid Hash
Posted by Maxim Solodovnik <so...@gmail.com>.
Hello,
hash created is "one time hash" maybe it was somehow already used? for
example hidden redirect happens?
On Tue, Mar 14, 2017 at 4:34 PM, 由超 <yo...@rimag.com.cn> wrote:
> Hello, all:
>
> I am using the PHP API to create room. The last step generates a URL I can
> use. When I went to the URL, "Invalid Hash" pops up. If I login, I can see
> the room is successfully created. OM version 3.2. If I use the swf way, the
> URL asked me to type in username and password.
>
> Thanks for any help.
>
>
> =============
> $gateway = new OmGateway(getOmConfig());
> if ($gateway->login()) {
> // do some logic gere
> $room_id = $gateway->updateRoom(getRoom());
> $options = array('roomId' => $room_id,'moderated' =>
> true,'allowRecording' => true);
> $user =
> $gateway->getUser('xiaoming','xiao','ming',null,'xiaoming@126.com','null');
> print_r($user);
> $HashValue = $gateway->getSecureHash($user,$options);
> echo $room_id . "\n";
> echo $HashValue . "\n";
> echo $gateway->getUrl() ."/hash?&secureHash=" . $HashValue .
> "&scopeRoomId=" . $room_id . "&language=1";
> echo "\n";
> //$url =
> 'http://192.168.1.151:5080/openmeetings'."/swf?&secureHash=" . $HashValue .
> "&scopeRoomId=" . $room_id . "&language=" . '11';
> //echo
> 'http://localhost:5080/openmeetings/swf?secureHash='.$HashValue .
> '&language=11';
> //header("Location:$url");
> } else {
> // notify user on bad config
> echo 'bad user config';
> }
> =================
>
--
WBR
Maxim aka solomax