h-mdm / hmdm-server

Mobile Device Management System for Android: web control panel. Manage Android devices, install and update apps, get device info. See website for more features!
https://h-mdm.com
Apache License 2.0
315 stars 141 forks source link

Security error on ActiveMX, devices can not connect to message broker #81

Closed leroy0211 closed 1 year ago

leroy0211 commented 1 year ago

Hi,

I got a Security error in the mdm server from all my devices. They can not connect to the queue due to the following reason:

Failed to add Connection id=ID:hmdm01-41253-1684843098146-3:20, clientId=H0010 due to java.lang.SecurityException: User name [hmdm] or password is invalid.

I guess the ActiveMX credentials in the launcher are wrong or somehow.

I do have installed the mdm server twice, because the first time the installation failed. I have not removed the installation before, and during the installation wizard I've entered all details the same as before.

HMDM Version: 5.18.2 Community Launcher version: 5.18 Update helper version: 1.04

I couldn't find any ActiveMX or MQTT parameters in ROOT.xml other than mqtt.server.uri (string) and mqtt.auth (boolean). But not a parameter where the credentials are stored.

Any direction to point me to, to fix this? Now application updates are not pushed, but only fetched if you press the "fetch updates" button.

h-mdm commented 1 year ago

We changed the preshared secret due to security reasons. Please turn off the mqtt.auth parameter (set it to 0), or fill in the form at https://h-mdm.com/contact-us/ to get the updated preshared secret (the parameter is in hash.secret). The value for the Community version can also be found in the source code (install/context_template.xml, server/build.properties.example).

leroy0211 commented 1 year ago

Where do you have to update it? In the launcher app, in the server or both?

BTW, this was a fresh install from last week, not an upgrade. Does that mean that every fresh install of the community edition doesn't work?

h-mdm commented 1 year ago

You must update it at the server. There was a bug in the install/context_template.xml which has been fixed.

leroy0211 commented 1 year ago

I've double checked, and the hash.secret is already at that new value.

<!-- A shared secret between mobile app and control panel.
         Don't change this unless you know what you're doing -->
    <Parameter name="hash.secret" value=[********-*#*#**##]"/>

BTW, I only get a log record whenever a device tries to connect. It's showing the ip of the device, not the server. So therefor I think the configuration is not OK in the launcher.

h-mdm commented 1 year ago

There was an issue in the shared secret on the client part, thank you for the bug report. The issue has been fixed in Headwind MDM launcher 5.19, please upgrade the client.