diff --git a/tools/api/commands/account_configuration_populate_user b/tools/api/commands/account_configuration_populate_user index 029a6471..73698f6a 100755 --- a/tools/api/commands/account_configuration_populate_user +++ b/tools/api/commands/account_configuration_populate_user @@ -20,5 +20,5 @@ jq -n \ |.primary_account_user_name = $username |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/activation_lock_bypass_code b/tools/api/commands/activation_lock_bypass_code index d1655060..f8088528 100755 --- a/tools/api/commands/activation_lock_bypass_code +++ b/tools/api/commands/activation_lock_bypass_code @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/available_os_updates b/tools/api/commands/available_os_updates index 1d427ede..ce08449d 100755 --- a/tools/api/commands/available_os_updates +++ b/tools/api/commands/available_os_updates @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/certificate_list b/tools/api/commands/certificate_list index 2389808c..960e4b4a 100755 --- a/tools/api/commands/certificate_list +++ b/tools/api/commands/certificate_list @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/device_configured b/tools/api/commands/device_configured index 3022207e..05fce319 100755 --- a/tools/api/commands/device_configured +++ b/tools/api/commands/device_configured @@ -8,4 +8,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/device_information b/tools/api/commands/device_information index d9587df9..9bbfbb34 100755 --- a/tools/api/commands/device_information +++ b/tools/api/commands/device_information @@ -9,4 +9,4 @@ jq -n \ |.request_type = $request_type |.queries = ($query_strings | split(",")) '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/device_lock b/tools/api/commands/device_lock index 1b24967f..b388f60d 100755 --- a/tools/api/commands/device_lock +++ b/tools/api/commands/device_lock @@ -9,4 +9,4 @@ jq -n \ |.pin = $pin |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/disable_remote_desktop b/tools/api/commands/disable_remote_desktop index bcccd39b..685a48d0 100755 --- a/tools/api/commands/disable_remote_desktop +++ b/tools/api/commands/disable_remote_desktop @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/enable_remote_desktop b/tools/api/commands/enable_remote_desktop index 8fca74d1..b8c9246b 100755 --- a/tools/api/commands/enable_remote_desktop +++ b/tools/api/commands/enable_remote_desktop @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/erase_device b/tools/api/commands/erase_device index 433516c1..98c83df3 100755 --- a/tools/api/commands/erase_device +++ b/tools/api/commands/erase_device @@ -9,4 +9,4 @@ jq -n \ |.pin = $pin |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/install_application b/tools/api/commands/install_application index 942bf509..acc95ba6 100755 --- a/tools/api/commands/install_application +++ b/tools/api/commands/install_application @@ -11,4 +11,4 @@ jq -n \ '|\ curl $CURL_OPTS \ -H "Content-Type: application/json" \ - -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/install_appstore_application b/tools/api/commands/install_appstore_application index c18e5cab..4dd065a6 100755 --- a/tools/api/commands/install_appstore_application +++ b/tools/api/commands/install_appstore_application @@ -11,4 +11,4 @@ jq -n \ '|\ curl $CURL_OPTS \ -H "Content-Type: application/json" \ - -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/install_enterprise_application b/tools/api/commands/install_enterprise_application index dc86947d..3bc9945f 100755 --- a/tools/api/commands/install_enterprise_application +++ b/tools/api/commands/install_enterprise_application @@ -11,4 +11,4 @@ jq -n \ '|\ curl $CURL_OPTS \ -H "Content-Type: application/json" \ - -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/install_profile b/tools/api/commands/install_profile index e15fd7c9..c747872b 100755 --- a/tools/api/commands/install_profile +++ b/tools/api/commands/install_profile @@ -9,4 +9,4 @@ jq -n \ |.payload = $payload |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/install_provisioning_profile b/tools/api/commands/install_provisioning_profile index 2eab4359..67b6b2f9 100755 --- a/tools/api/commands/install_provisioning_profile +++ b/tools/api/commands/install_provisioning_profile @@ -9,4 +9,4 @@ jq -n \ |.provisioning_profile = $provisioning_profile |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/installed_application_list b/tools/api/commands/installed_application_list index 0b6099c9..90086470 100755 --- a/tools/api/commands/installed_application_list +++ b/tools/api/commands/installed_application_list @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/os_update_status b/tools/api/commands/os_update_status index e93031da..ac36e1c0 100755 --- a/tools/api/commands/os_update_status +++ b/tools/api/commands/os_update_status @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/profile_list b/tools/api/commands/profile_list index 25e744ef..9be3254a 100755 --- a/tools/api/commands/profile_list +++ b/tools/api/commands/profile_list @@ -9,4 +9,4 @@ jq -n \ '|\ curl $CURL_OPTS \ -H "Content-Type: application/json" \ - -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + -K <(cat <<< "-u \"micromdm:$API_TOKEN\"") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/provisioning_profile_list b/tools/api/commands/provisioning_profile_list index e74cef94..46b154b7 100755 --- a/tools/api/commands/provisioning_profile_list +++ b/tools/api/commands/provisioning_profile_list @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/remove_profile b/tools/api/commands/remove_profile index fd88c040..cf8a3961 100755 --- a/tools/api/commands/remove_profile +++ b/tools/api/commands/remove_profile @@ -4,9 +4,9 @@ endpoint="v1/commands" jq -n \ --arg request_type "RemoveProfile" \ --arg udid "$1" \ - --arg identifier $2 \ + --arg identifier "$2" \ '.udid = $udid |.identifier = $identifier |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/remove_provisioning_profile b/tools/api/commands/remove_provisioning_profile index b81f9aa1..a9b19bba 100755 --- a/tools/api/commands/remove_provisioning_profile +++ b/tools/api/commands/remove_provisioning_profile @@ -9,4 +9,4 @@ jq -n \ |.uuid = $uuid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/restart_device b/tools/api/commands/restart_device index 8f5487e4..316b9246 100755 --- a/tools/api/commands/restart_device +++ b/tools/api/commands/restart_device @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/schedule_os_update b/tools/api/commands/schedule_os_update index 42482046..5939b955 100755 --- a/tools/api/commands/schedule_os_update +++ b/tools/api/commands/schedule_os_update @@ -13,4 +13,4 @@ jq -n \ |.install_action = $install_action ] '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/schedule_os_update_scan b/tools/api/commands/schedule_os_update_scan index e68ea34f..15e86f6d 100755 --- a/tools/api/commands/schedule_os_update_scan +++ b/tools/api/commands/schedule_os_update_scan @@ -9,4 +9,4 @@ jq -n \ |.request_type = $request_type |.force = $force '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/security_info b/tools/api/commands/security_info index ce0a52c6..25b37930 100755 --- a/tools/api/commands/security_info +++ b/tools/api/commands/security_info @@ -7,4 +7,4 @@ jq -n \ '.udid = $udid |.request_type = $request_type '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/set_bootstrap_token b/tools/api/commands/set_bootstrap_token index 6dcd8d1e..1c69a233 100755 --- a/tools/api/commands/set_bootstrap_token +++ b/tools/api/commands/set_bootstrap_token @@ -9,4 +9,4 @@ jq -n \ |.request_type = $request_type |.bootstrap_token = $token '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/commands/settings_application_configuration b/tools/api/commands/settings_application_configuration index 03f5ff82..dd46b6b7 100755 --- a/tools/api/commands/settings_application_configuration +++ b/tools/api/commands/settings_application_configuration @@ -30,4 +30,4 @@ jq -n \ |.settings[0].identifier = $identifier |.settings[0].configuration = $payload '|\ - curl $CURL_OPTS -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" -d@- + curl $CURL_OPTS -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint" -d@- diff --git a/tools/api/get_devices b/tools/api/get_devices index 4dcbf5a0..3ee0f5c3 100755 --- a/tools/api/get_devices +++ b/tools/api/get_devices @@ -1,4 +1,4 @@ #!/bin/bash source $MICROMDM_ENV_PATH endpoint="v1/devices" -curl $CURL_OPTS -X POST --data-binary {} -s -u "micromdm:$API_TOKEN" "$SERVER_URL/$endpoint" +curl $CURL_OPTS -X POST --data-binary {} -s -K <(cat <<< "-u micromdm:$API_TOKEN") "$SERVER_URL/$endpoint"