Enrollment fails with 401 authentication error

Learn how to resolve the issue when the enrollment fails with 401 authentication error when there is no issue with LDAP.

Problem

Enrollment fails with 401 authentication error. On ping tests, Docker containers could not ping properly. For example, Openresty is not able to reach MDM server.

Cause

DNS resolution issues. Docker containers on MDM server do not resolve DNS network hostnames.

Solution

  1. Restart Docker using the service Docker restart command.
  2. If the issue persists, if you are not using the DNS, enter the following extra_hosts entry manually in the docker-compose.yml file at /var/opt/BESUEM/ and restart the MDM server containers.
    extra_hosts:
    - "<hostname>:<IP>"
    where <hostname>:<IP> is the MDM server hostname and IP Address.
    Note:
    • You must indent the added entries properly to get the expected result.
    • If the install or upgrade Fixlet is run after the changes in the .yml file, you must add the entries manually again and restart MDM server containers.

  3. Login to the windowsmdm container using docker exec -it windowsmdm sh and check if the /etc/hosts file has the above hostname and IP address entry.

  4. Ping the hostname from within the container to see if it is resolving properly.

The following docker-compose.yml screenshot shows the sample extra-hosts line added. You must add the extra-hosts entries for windowsmdm, androidmdm, and applemdm docker containers as applicable for your environment. This allows docker containers to resolve hostnames that are not resolvable.