I play with open source iLoot , which allows iCloud backups to be downloaded, and I was wondering how two authentication factors could be implemented.
I have a 2fa account enabled in my account and I get the first request:
First request:
auth = "Basic %s" % base64.b64encode("%s:%s" % (login, password)) authenticateResponse = plist_request("setup.icloud.com", "POST", "/setup/authenticate/$APPLE_ID$", "", {"Authorization": auth})
plist_request is just a regular python ( request ) function that requests a url from it and returns the parsed xml.
First answer (in xml format):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>protocolVersion</key> <string>2</string> <key>title</key> <string>Verification Required</string> <key>localizedError</key> <string>MOBILEME_TERMS_OF_SERVICE_UPDATE</string> <key>message</key> <string>This Apple ID is protected with two-step verification. To sign in, you must verify your identity.</string> </dict> </plist> Request /setup/authenticate/$APPLE_ID$ returned code 409
In case anyone knows what the next call will be for entering a two-step verification code, this can help figure this out.
source share