Talking to v13 Application Platform using C#: password for innovaphone-devices AddDomain
Summary: How do I calculate domain password for a new domain in innovaphone-devices, when WebSocket connection was established with UserPBXLoginWithAppAutomaton?
The details: I have a C# application, that tries to implement the content of websocket.class.php described here: https://wiki.innovaphone.com/index.php?title=Reference13r1:Concept_Talking_to_the_v13_Application_Platform_using_PHP
I use the UserPBXLoginWithAppAutomaton to Login to PBX and App innovaphone-devices. After the complex login stuff I have two WebSocket connections, one to PBX and one to innovaphone-devices. Now a new domain is added with WebSocketMessage {"mt":"AddDomain","seed":"V13test”,…} on the innovaphone-devices WebSocket connection. The new domain is finally there, but the calculated password is obviously wrong (I cannot login to devices of this domain).
I carefully read following helpful thread, describing similar problem:
I get the same values described there, when using sha256 and RC4 with the examples. So I assume, that encryption is implemented correctly. The thread describes, that I initially have to get SessionKey which is
SHA256 of the string "innovaphoneAppSessionKey:challenge:password".
The “innovaphoneAppSessionKey” is a fixed string. As “challenge” I use the challenge value in AppChallengeResult message, received from innovaphone-devices WebSocket. But what is the “password” here? There seems not to exist password on this innovaphone-devices-WebSocket connection, because login was done with user/password via PBX-WebSocket connection.
I tried following SessionKeys without success:
- SHA256 of: AppChallengeResult.challenge and “password”=Password used for PBX login on PBX-WebSocket connection; e.g.: “innovaphoneAppSessionKey:6ecfe66d12556d36:pwd”
- SHA256 of: AppChallengeResult.challenge and Empty password; e.g.: “innovaphoneAppSessionKey:6ecfe66d12556d36:”
- SHA256 of: AppChallengeResult.challenge and Empty password; e.g.: “innovaphoneAppSessionKey:6ecfe66d12556d36”
- SHA256 of: PBX-WebSocket.Authenticate.challenge + “password” = Password used for PBX login on PBX WebSocket connection; e.g.: “innovaphoneAppSessionKey:55e0b97755e0b950:pwd”
- Using received message value PBX-WebSocket.AppGetLoginResult.key on PBX WebSocket connection as SessionKey
After assuming to have correct SessionKey, I use RC4 encryption. The seed is the same value as used in WebSoketMessage that is used to add domain {"mt":"AddDomain","seed":"V13test”,…}:
RC4.Encrypt(clearTextPassword, String.Format("{0}:{1}", seed, SessionKey));
Any help is appreciated!
Kind regards
Uwe