Device not connecting to WiFi - via MDM mobile config

We are trying to push a WiFi mobile config to a fleet of devices. Before mass deployment, we tried manually installing the WiFi mobile config in one Mac device.

During manual profile installation

  1. It asks for a username-password. (Please see the image)
  2. I just click Install without providing anything.
  3. The device auto-joins with the WiFi, without asking for username and password

We then pushed the same exact mobile config file via a MDM solution, and the profile installs fine.

But the device doesn't auto-join the WiFi, and when I choose the WiFi network, it asks for a username and password, even though I have configured SystemModeCredentialsSource to be ActiveDirectory

We have double-checked that there're no changes made to mobile config when deployed via MDM.

Mobile Config:

<dict>
    <key>AutoJoin</key>
    <true/>
    <key>SetupModes</key>
    <array>
             <string>System</string>
             <string>Loginwindow</string>
    </array>
    <key>EAPClientConfiguration</key>
    <dict>
        <key>AcceptEAPTypes</key>
        <array>
            <integer>25</integer>
            <integer>21</integer>
        </array>
        <key>PayloadCertificateAnchorUUID</key>
        <array>
            <string>UUID_here</string>
            <string>UUID_here</string>
            <string>UUID_here</string>
        </array>
        <key>TTLSInnerAuthentication</key>
        <string>MSCHAPv2</string>
        <key>SystemModeCredentialsSource</key>
        <string>ActiveDirectory</string>
    </dict>
    <key>EncryptionType</key>
    <string>WPA2</string>
    <key>HIDDEN_NETWORK</key>
    <false/>
    <key>PayloadDescription</key>
    <string>Configures Wi-Fi settings</string>
    <key>PayloadDisplayName</key>
    <string>Wi-Fi</string>
    <key>PayloadIdentifier</key>
    <string>com.test.wifi1</string>
    <key>PayloadType</key>
    <string>com.apple.wifi.managed</string>
    <key>PayloadUUID</key>
    <string>UUID_here</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
    <key>SSID_STR</key>
    <string>Test</string>
</dict>

As a trial and error, We tried providing empty username-password and false to OneTimeUserPassword, in the EAPClientConfiguration, but still when connecting to the WiFi, I'm prompted for username and password.

<key>OneTimeUserPassword</key>
<false/>
<key>UserName</key>
<string></string>
<key>UserPassword</key>
<string></string>

We are stuck in this for days. Any help would be appreciated. Please free feel to ask for more details if needed. Thanks in advance.

Device not connecting to WiFi - via MDM mobile config
 
 
Q