Caldav two-step verification

I'm using caldav to fetch events from iCloud.

First request is to get dsprsid and mmeAuthToken from appleId and password

Normally the first request will be:


auth = "Basic %s" % base64.b64encode("%s:%s" % (appleId, password))
requests.get("https://setup.icloud.com/setup/authenticate/%s" % appleId, headers={"Authorization": auth})


But when I insert appleId which enabled two-step verification the response will be:


<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>


Does someone know from where I continue from here? What should be the next call?

Thanks!

Caldav two-step verification
 
 
Q