Pal websocket: You are not authorized to perform this operat

Discuss any topic about Brekeke PBX.

Moderator: Brekeke Support Team

Post Reply
phamduoc
Posts: 11
Joined: Tue Dec 16, 2014 8:21 pm

Pal websocket: You are not authorized to perform this operat

Post by phamduoc »

1. Brekeke Product Name and Version:
3.3.8.1
2. Java version:
1.7(64bit)
3. OS type and the version:
win8
4. UA (phone), gateway or other hardware/software involved:

5. Your problem:
After I login through the login() method with the sa user, I call method getRouteTemplateNames:

var m = {"jsonrpc": "2.0", "method": "getRouteTemplateNames", "params": {"tenant":""} , "id": id};
var mesg = JSON.stringify( m );
id++;
socket.send(mesg);

I received the following message:

"You are not authorized to perform this operation."

I also execute this method using web service, It's executed successfully. In the developer's guide, the required permission is sa. Please tell me the solution to fix this problem.

Thanks,
llucy
Posts: 52
Joined: Fri Jan 31, 2014 1:08 am

Post by llucy »

What was the JSON like for login?

Lucy
phamduoc
Posts: 11
Joined: Tue Dec 16, 2014 8:21 pm

Post by phamduoc »

llucy wrote:What was the JSON like for login?

Lucy
Thank Lucy,
I base on sample on website:
http://www.brekeke.com/downloads/pbx-de ... #websocket

JSON:

var m = {"jsonrpc": "2.0", "method": "login", "params": {"login_password": login_str_cryp} , "id":id};
var mesg = JSON.stringify( m );
id++;
socket.send(mesg);
llucy
Posts: 52
Joined: Fri Jan 31, 2014 1:08 am

Post by llucy »

Can you show me the response to it as well?
What was the WebSocket URL?

Lucy
phamduoc
Posts: 11
Joined: Tue Dec 16, 2014 8:21 pm

Post by phamduoc »

llucy wrote:Can you show me the response to it as well?
What was the WebSocket URL?

Lucy
Thanks Lucy,

Can you show me the response to it as well?
"{"jsonrpc": "2.0", "error": {"code": -2000, "message": "You are not authorized to perform this operation."}, "id": "3"}"

What was the WebSocket URL?
"ws://172.18.23.89:18080/pbx/ws?tenant=-&login_user=sa&user=sa"
llucy
Posts: 52
Joined: Fri Jan 31, 2014 1:08 am

Post by llucy »

>>"ws://172.18.23.89:18080/pbx/ws?tenant=-&login_user=sa&user=sa"

Please try with "ws://172.18.23.89:18080/pbx/ws?login_user=sa".
If you set tenant, it will act as an adin for the tenant level.

Lucy
phamduoc
Posts: 11
Joined: Tue Dec 16, 2014 8:21 pm

Post by phamduoc »

llucy wrote:>>"ws://172.18.23.89:18080/pbx/ws?tenant=-&login_user=sa&user=sa"

Please try with "ws://172.18.23.89:18080/pbx/ws?login_user=sa".
If you set tenant, it will act as an adin for the tenant level.

Lucy
Thanks Lucy,

It's done for me.
Post Reply