Auth login to app via websocket
@Customer Softnet
@Support Softnet
Dear
I am trying to get auth working for websocket to be able to retrive session and key and then getting csv data for calls.
From your wiki login should be like that (url: ws://PBX_IP/PBX0/APPS/websocket).
{
"app": "reporting",
"digest": "a205299ed2ef2786c311e0be1b14db343f2cadd906a6ae7b564eee34bda5e9a1",
"dn": "",
"domain": "",
"guid": "",
"mt": "AppLogin",
"sip": ""
}
The poing here for me i guss is how to calculate digest.
From your wiki it should be: SHA256
and it should be calculated like:
<app>:<domain>:<sip>:<guid>:<dn>:<challenge>:<password>
reporting:softnet:::challenge:pwd (is this right or should be anything alse here? do i need info?)
challenge i get from { "mt": "AppChallenge" }
pwd is password for pbx (what about userpart, is not needed?)
Problem is that I am always getting false. Can you help me if I do right SHA256 calculation for reporting or missing something? I can see from console log in www that myapps is connecting to websocket url like: wss://app.innovaphone.softnet.si/softnet/reporting/132852
So which url is correct to use? If I use wss://app.innovaphone.softnet.si/softnet/reporting/132852 and do AppLogin socket connecton is closed. For ip to PBX i get back false (ws://PBX_IP/PBX0/APPS/websocket).
@Support Softnet
Dear
I am trying to get auth working for websocket to be able to retrive session and key and then getting csv data for calls.
From your wiki login should be like that (url: ws://PBX_IP/PBX0/APPS/websocket).
{
"app": "reporting",
"digest": "a205299ed2ef2786c311e0be1b14db343f2cadd906a6ae7b564eee34bda5e9a1",
"dn": "",
"domain": "",
"guid": "",
"mt": "AppLogin",
"sip": ""
}
The poing here for me i guss is how to calculate digest.
From your wiki it should be: SHA256
and it should be calculated like:
<app>:<domain>:<sip>:<guid>:<dn>:<challenge>:<password>
reporting:softnet:::challenge:pwd (is this right or should be anything alse here? do i need info?)
challenge i get from { "mt": "AppChallenge" }
pwd is password for pbx (what about userpart, is not needed?)
Problem is that I am always getting false. Can you help me if I do right SHA256 calculation for reporting or missing something? I can see from console log in www that myapps is connecting to websocket url like: wss://app.innovaphone.softnet.si/softnet/reporting/132852
So which url is correct to use? If I use wss://app.innovaphone.softnet.si/softnet/reporting/132852 and do AppLogin socket connecton is closed. For ip to PBX i get back false (ws://PBX_IP/PBX0/APPS/websocket).
06-04 07:30:34.396 reporting@softnet IWebsocket(connection id: 61325)::SocketRecvResult(): Received Websocket message WS_WEBSOCKET_RECV_RESULT (fragmented: false, text: true, data size: 167)
06-04 07:30:34.396 00F98380 - 7B 0A 20 20 20 20 22 61 70 70 22 3A 20 22 69 6E {. "app": "in
06-04 07:30:34.396 00F98390 - 6E 6F 76 61 70 68 6F 6E 65 2D 72 65 70 6F 72 74 novaphone-report
06-04 07:30:34.396 00F983A0 - 69 6E 67 22 2C 0A 20 20 20 20 22 64 69 67 65 73 ing",. "diges
06-04 07:30:34.396 00F983B0 - 74 22 3A 20 22 61 32 30 35 32 39 39 65 64 32 65 t": "a205299ed2e
06-04 07:30:34.396 00F983C0 - 66 32 37 38 36 63 33 31 31 65 30 62 65 31 62 31 f2786c311e0be1b1
06-04 07:30:34.396 00F983D0 - 34 64 62 33 34 33 66 32 63 61 64 64 39 30 36 61 4db343f2cadd906a
06-04 07:30:34.396 00F983E0 - 36 61 65 37 62 35 36 34 65 65 65 33 34 62 64 61 6ae7b564eee34bda
06-04 07:30:34.396 00F983F0 - 35 65 39 61 31 22 2C 0A 20 20 20 20 22 64 6F 6D 5e9a1",. "dom
06-04 07:30:34.396 00F98400 - 61 69 6E 22 3A 20 22 73 6F 66 74 6E 65 74 22 2C ain": "softnet",
06-04 07:30:34.396 00F98410 - 0A 20 20 20 20 22 6D 74 22 3A 20 22 41 70 70 4C . "mt": "AppL
06-04 07:30:34.396 00F98420 - 6F 67 69 6E 22 0A 7D ogin".}
06-04 07:30:34.396 reporting@softnet WebserverWebsocketHandler(00fb06a0,00fc85f0,61325)::Send buffer:0xd5297e10 len:53 text:TRUE
06-04 07:30:34.396 D5297E10 - 7B 22 6D 74 22 3A 22 41 70 70 4C 6F 67 69 6E 52 {"mt":"AppLoginR
06-04 07:30:34.396 D5297E20 - 65 73 75 6C 74 22 2C 22 61 70 70 22 3A 22 69 6E esult","app":"in
06-04 07:30:34.396 D5297E30 - 6E 6F 76 61 70 68 6F 6E 65 2D 72 65 70 6F 72 74 novaphone-report
06-04 07:30:34.396 D5297E40 - 69 6E 67 22 7D ing"}
06-04 07:30:34.396 reporting@softnet WebserverMessage(connection id: 59608)::WebsocketSend: Sending Websocket message WS_WEBSOCKET_SEND (fragmented: false, text: true, sdata ize: 53)
06-04 07:30:34.396 D5297E10 - 7B 22 6D 74 22 3A 22 41 70 70 4C 6F 67 69 6E 52 {"mt":"AppLoginR
06-04 07:30:34.396 D5297E20 - 65 73 75 6C 74 22 2C 22 61 70 70 22 3A 22 69 6E esult","app":"in
06-04 07:30:34.396 D5297E30 - 6E 6F 76 61 70 68 6F 6E 65 2D 72 65 70 6F 72 74 novaphone-report
06-04 07:30:34.396 D5297E40 - 69 6E 67 22 7D ing"}
06-04 07:30:34.396 reporting@softnet AppWebsocket(00fc85f0)::Error
06-04 07:30:34.396 reporting@softnet WebserverWebsocketHandler(00fb06a0,00fc85f0,61325)::Close
thank you for all help!
Uros
thank you for all help!
Uros