Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[China] For China region iCloud service, the 2 factor authentication fails. #717

Closed
lemonahmas opened this issue Nov 27, 2023 · 7 comments
Closed
Labels

Comments

@lemonahmas
Copy link

Overview

The 2 factor authentication fails due to "IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, accountservice.p00.prod.me.com"

Steps to Reproduce

  1. icloudpd --directory /icloud_data --username {} --password {} --domain cn --watch-with-interval 3600
  2. enter

Expected Behavior

2FA correctly

Actual Behavior

2023-11-27 20:22:43 DEBUG Authenticating...
2023-11-27 20:22:46 INFO Two-step/two-factor authentication is required
2023-11-27 20:22:47 ERROR statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, accountservice.p00.prod.me.com.
Traceback (most recent call last):
File "starters/icloudpd.py", line 5, in
File "click/core.py", line 1157, in call
File "click/core.py", line 1078, in main
File "click/core.py", line 1434, in invoke
File "click/core.py", line 783, in invoke
File "icloudpd/base.py", line 317, in main
File "icloudpd/base.py", line 744, in core
File "icloudpd/authentication.py", line 48, in authenticate_
File "icloudpd/authentication.py", line 55, in request_2sa
File "pyicloud_ipd/base.py", line 266, in trusted_devices
File "requests/sessions.py", line 602, in get
File "pyicloud_ipd/base.py", line 105, in request
File "pyicloud_ipd/base.py", line 127, in _raise_error
pyicloud_ipd.exceptions.PyiCloudAPIResponseError: statusCode = UnknownServerError, IOException sending request https://accountservice.p00.prod.me.com:443/api/get_challenge_devices, accountservice.p00.prod.me.com.
[989430] Failed to execute script 'icloudpd' due to unhandled exception!

However the API invocation seems reached the endpoint, my iphone got a notification with 6-digit code.

Context

@lemonahmas lemonahmas added the bug label Nov 27, 2023
@AndreyNikiforov
Copy link
Collaborator

Was icloudpd ever working for you or you are trying for the first time?

There are posts about icloudpd failing in mainland China for some and there are posts suggesting icloudpd working in mainland China for others. Until somebody debugs iCloud calls from that location, I have no idea how we can resolve the issue.

@lemonahmas
Copy link
Author

Was icloudpd ever working for you or you are trying for the first time?

There are posts about icloudpd failing in mainland China for some and there are posts suggesting icloudpd working in mainland China for others. Until somebody debugs iCloud calls from that location, I have no idea how we can resolve the issue.

Hi @AndreyNikiforov, thank you for your reply. I am just trying this project for the first time.

I do have read those threads but still a little bit curious about this one since it seems like the 2FA request is sent correctly.

I will try to debug it from my location here in China when I got time and see if there is any clue.

@lemonahmas
Copy link
Author

lemonahmas commented Nov 27, 2023

@AndreyNikiforov AndreyNikiforov changed the title For China region iCloud service, the 2 factor authentication fails. [China] For China region iCloud service, the 2 factor authentication fails. Dec 3, 2023
@AndreyNikiforov
Copy link
Collaborator

@lemonahmas do you still have issues with 2fa from China using latest icloudpd?

@lemonahmas
Copy link
Author

Hi @AndreyNikiforov Thanks for letting me know about the update. I have been using the docker version since last year, haven't had time to test the latest version of the native software version of icloudpd. Good to know you have port the change though, thanks!😃

@boredazfcuk
Copy link
Contributor

Well I think this docker file's fix explains everything - https://github.com/boredazfcuk/docker-icloudpd/blob/1a8530bf88a0c815a850f17f6f57db135e5c0d91/icloudpd.dockerfile#L25

That's obsolete code. China fix was something I added to my container but is no longer needed. Apple broke the authentication API and when it was fixed, it was fixed for Global and Chinese users.

@AndreyNikiforov
Copy link
Collaborator

Well I think this docker file's fix explains everything - https://github.com/boredazfcuk/docker-icloudpd/blob/1a8530bf88a0c815a850f17f6f57db135e5c0d91/icloudpd.dockerfile#L25

That's obsolete code. China fix was something I added to my container but is no longer needed. Apple broke the authentication API and when it was fixed, it was fixed for Global and Chinese users.

closing then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants