-
-
Save bufordtaylor/2cd615f55724173dee246bf79653534d to your computer and use it in GitHub Desktop.
Revisions
-
ericboehs created this gist
Oct 25, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #! /usr/bin/env bash export APPLE_USER=user@example.com export APPLE_PASS=password1 export AUTH_PLIST=$(curl -su "$APPLE_USER:$APPLE_PASS" "https://setup.icloud.com/setup/authenticate/$APPLE_USER") export DSID=$(/usr/libexec/PlistBuddy -c "Print appleAccountInfo:dsid" /dev/stdin <<< $AUTH_PLIST) echo $DSID export TEMP_MME_AUTH_TOKEN=$(/usr/libexec/PlistBuddy -c "Print tokens:mmeAuthToken" /dev/stdin <<< $AUTH_PLIST) echo $TEMP_MME_AUTH_TOKEN # It seems this step is unnecessary as the mme auth tokens are the same # export SETTINGS_PLIST=$(curl -su "$DSID:$TEMP_MME_AUTH_TOKEN" "https://setup.icloud.com/setup/get_account_settings") # echo $SETTINGS_PLIST # export MME_AUTH_TOKEN=$(/usr/libexec/PlistBuddy -c "Print tokens:mmeAuthToken" /dev/stdin <<< $SETTINGS_PLIST) # echo $MME_AUTH_TOKEN export MME_AUTH_TOKEN=$TEMP_MME_AUTH_TOKEN export TOKEN=$(echo "$DSID:$MME_AUTH_TOKEN" | base64) echo $TOKEN curl -X PROPFIND https://p01-caldav.icloud.com -H "Depth: 1" -H "Authorization: X-MobileMe-AuthToken $TOKEN" \ --data '<d:propfind xmlns:d="DAV:"><d:prop><d:current-user-principal /></d:prop></d:propfind>'