-
-
Save bufordtaylor/2cd615f55724173dee246bf79653534d to your computer and use it in GitHub Desktop.
This file contains 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 characters
#! /usr/bin/env bash | |
export [email protected] | |
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>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment