Skip to content

Commit

Permalink
Release v1.10.1 (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzapponi authored Feb 1, 2021
1 parent 8671cc6 commit 1725d35
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
22 changes: 19 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,28 @@ If you would like to delete a password stored in your system keyring, you can cl
Two-step and two-factor authentication (2SA/2FA)
************************************************

If you have enabled `two-step authentication (2SA) <https://support.apple.com/en-us/HT204152>`_ for the account you will have to do some extra work:
If you have enabled two-factor authentications (2FA) or `two-step authentication (2SA) <https://support.apple.com/en-us/HT204152>`_ for the account you will have to do some extra work:

.. code-block:: python
if api.requires_2sa:
if api.requires_2fa:
print "Two-factor authentication required."
code = input("Enter the code you received of one of your approved devices: ")
result = api.validate_2fa_code(code)
print("Code validation result: %s" % result)
if not result:
print("Failed to verify security code")
sys.exit(1)
if not api.is_trusted_session:
print("Session is not trusted. Requesting trust...")
result = api.trust_session()
print("Session trust result %s" % result)
if not result:
print("Failed to request trust. You will likely be prompted for the code again in the coming weeks")
elif api.requires_2sa:
import click
print "Two-step authentication required. Your trusted devices are:"
Expand All @@ -88,7 +105,6 @@ If you have enabled `two-step authentication (2SA) <https://support.apple.com/en
print "Failed to verify verification code"
sys.exit(1)
This approach also works if the account is set up for `two-factor authentication (2FA) <https://support.apple.com/en-us/HT204915>`_, but the authentication will time out after a few hours. Full support for two-factor authentication (2FA) is not implemented in PyiCloud yet. See issue `#102 <https://github.com/picklepete/pyicloud/issues/102>`_.
Devices
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from codecs import open

REPO_URL = "https://github.com/picklepete/pyicloud"
VERSION = "0.9.7"
VERSION = "0.10.1"

with open("requirements.txt") as f:
required = f.read().splitlines()
Expand Down

0 comments on commit 1725d35

Please sign in to comment.