Release v0.10.2 (#321)
This commit is contained in:
parent
8671cc6e2c
commit
bab549a593
2 changed files with 20 additions and 4 deletions
22
README.rst
22
README.rst
|
@ -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)
|
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
|
.. 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
|
import click
|
||||||
print "Two-step authentication required. Your trusted devices are:"
|
print "Two-step authentication required. Your trusted devices are:"
|
||||||
|
|
||||||
|
@ -88,7 +105,6 @@ If you have enabled `two-step authentication (2SA) <https://support.apple.com/en
|
||||||
print "Failed to verify verification code"
|
print "Failed to verify verification code"
|
||||||
sys.exit(1)
|
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
|
Devices
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||||
from codecs import open
|
from codecs import open
|
||||||
|
|
||||||
REPO_URL = "https://github.com/picklepete/pyicloud"
|
REPO_URL = "https://github.com/picklepete/pyicloud"
|
||||||
VERSION = "0.9.7"
|
VERSION = "0.10.2"
|
||||||
|
|
||||||
with open("requirements.txt") as f:
|
with open("requirements.txt") as f:
|
||||||
required = f.read().splitlines()
|
required = f.read().splitlines()
|
||||||
|
|
Loading…
Reference in a new issue