Picture of Uwe 2460
Registered 9 years 253 days
Uwe 2460 Monday, 4 March 2024, 08:56 AM
Working Manager App: result AccessDenied on mt:WriteConfig, special login needed?
Hi all,

I’m currently implementing automation for optional installation and base configuration of Working App. Optional apps should only be installed on customer PBX, when respective article is ordered by customer.

After creating working app instance via manager, a direct login to app instance (service “innovaphone-working-manager”) is done. Next the SMTP settings are to be configured via {"mt":"WriteConfig","api":"Config",… . But all my attempts are failing so far with result “AccessDenied”.
The mt:WriteConfig works with a lot of other apps. With working app there must be something special. Please advice!

message flow example:
##########################################################
-->: {"mt":"AppChallenge"}
<--: {"mt":"AppChallengeResult","challenge":"2**************a"}
-->: {"mt":"AppLogin","app":"manager","domain":"","sip":"manager","guid":"00000000000000000000000000000000","dn":"Admin","digest":"efcc27d3c6af29023fd256e95347eb51a882f0380c19d6f38630fbd000dde308","pbxObj":"manager"}
<--: {"mt":"AppLoginResult","app":"manager","ok":true}
-->: {"mt":"AddInstance","appServiceID":"working","appName":"working","appDomain":"v13test.vpbx.myadmin.cloud","appPassword":"**removed by logging**","webserverPath":"v13test.vpbx.myadmin.cloud/working","dbHost":"","dbName":"v13test.vpbx.myadmin.cloud_working","dbUser":"v13test.vpbx.myadmin.cloud_working","dbPassword":"**removed by logging**","excludeFromBackup":false}
<--: {"mt":"AddInstanceResult"}
-->: {"mt":"StartInstance","appServiceID":"working","appName":"working","appDomain":"v13test.vpbx.myadmin.cloud"}
<--: {"mt":"StartInstanceResult"}
-->: {"mt":"AppChallenge"}
<--: {"mt":"AppChallengeResult","challenge":"7**************e"}
-->: {"mt":"AppLogin","app":"innovaphone-working-manager","domain":"v13test.vpbx.myadmin.cloud","sip":"working","guid":"00000000000000000000000000000000","dn":"working","digest":"2d0cef743ec75d9f807f4350753c50b97c1d62dd32023000b803c038316487c2","pbxObj":"working"}
<--: {"mt":"AppLoginResult","app":"innovaphone-working-manager","domain":"v13test.vpbx.myadmin.cloud","ok":true}
-->: {"mt":"WriteConfig","api":"Config","ConfigItems":{"smtp_server":"securesmtp.t-online.de:587","smtp_User":"ut","smtp_pwd":{"value":"f99968b93d4a32523498","key":"31B8J64F~FF2"},"smtp_host":"v13test.vpbx.myadmin.cloud"},"src":"WorkingManagerSettingsAutomaton"}
<--: {"api":"Config","mt":"WriteConfigResult","src":"WorkingManagerSettingsAutomaton","result":"AccessDenied"}
##########################################################

Thanks in advance
Uwe

Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Wednesday, 6 March 2024, 11:16 AM
Re: Working Manager App: result AccessDenied on mt:WriteConfig, special login needed?
Hello Uwe,

instead of "app":"innovaphone-working-manager" you have to use "app":"-" to simulate a login from PBX Manager.

To debug the login you have to activate "App" and "AppWebsocket" flag on the app instance and check the app log.

The "mode" should be "pbx-manager" to be able to access the config items:
AppWebsocketConnectComplete(sip=admin, dn=Admin, domain=test.com, url=(null), app=-) sessionKey=..., mode=pbx-manager

Best Regards
Andreas Fink
Picture of Uwe 2460
Registered 9 years 253 days
Uwe 2460 Thursday, 7 March 2024, 09:13 AM
Re: Working Manager App: result AccessDenied on mt:WriteConfig, special login needed?
Hello Andreas,

thanks for quick reply.
Using "app":"-","sip":"admin","dn":"Admin"... for AppLogin obviously fixes it.
"mt":"WriteConfig" returns with "result":"ok" now.

The "mode"="pbx-manager" seems currently (in V13R3 environment) not to make any difference.

kind regards
Uwe
← You can define your color theme preference here