-
Notifications
You must be signed in to change notification settings - Fork 573
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
401 response when authenticating with version 1.24.0 #975
Comments
I have the same problem, but I get a different error code from the API:
|
The only ref to -20283 error code mentions app-specific password, which do not work for icloud photos. I have no clue what both of these codes mean. General ideas to experiment with password issues:
|
I checked that my account has app specific password from long ago and I am able to authenticate with regular password in 1.24.0 |
Cookie removal or explicitly setting the provider to console didn't help. Setting a new password for the account solves the problem, I found the solution in this fastlane issue. |
Thanks! I can confirm this solved the issue for me too. |
We are seeing this error as well with one of our users that has a more recently set password. Using the Windows version of 1.24.0. Here is the error generated: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
An update - had the user update their password on iCloud and tried again with the new credentials. Same problem. Here is the output: Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I had the same problem even after I changed my password. |
With this one particular user we are using --username --password and --auth-only but each time we receive the error/output that I posted above. We had a few other users that needed to reauthenticate and they worked with no issue. It (so far) is only with this one user. Again, had this user change their password at iCloud.Com and it was checked and verifed but when using iCloudPD still this error. |
Wasn't enough for me. What helped was this:
(I removed the cookies first: |
Thanks @Sonnenfleck. That also worked for me. |
We tried the suggestion above using the additional items and on this one account (verified to work on iCloud.Com) still receiving an error: Output here: The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I tried deleting cookies as well, nothing works.
|
another project hints there is a bug in upstream SRP implementation in handling salts that started with zeros. That explains why errors appear for certain account only (salt is persisted per account) and why changing password fixes the issue (presumably salt is re-generated). There is no explicit confirmation that bug fix worked (e.g. account with error would start working without password reset) though. |
1.24.2 has the fix. |
Still not able to get it to work. Tried deleting cookies and recreating. Tried 3 different Apple accounts.
|
A number of thoughts on the subject:
|
This worked! Thanks. Also, for whatever reason I'm again able to remove the --password from my script and rely completely on the saved keyring. |
@CreativePR try latest (1.24.3 as of writing), clearing cookies. If still see the same error, post: a) cmd line using downloaded binary b) output (as you were doing before) |
Downloaded the 1.24.3 release for Windows and this was the error output on that same account: 2024-11-03 21:20:04 DEBUG Authenticating... The above exception was the direct cause of the following exception: Traceback (most recent call last): Other accounts are not having a problem reauthenticating (as before) - it is only this one account. Verified that the account can be logged in with the same exact credentials on icloud.com |
same here |
Starting from an hour ago, requests to signin/init are giving 503 responses. Is anyone facing similar issue? Update: It's working again now. It was failing on multiple accounts that worked before even with different PCs. Weird. |
Just bumping this as it seems like I have the same problem. I am running 1.24.4 on Ubuntu 22.04.5 LTS. I've tried everything in this thread (including clearing cookies, deleting user from keychain using icloud command, etc - I did not change my icloud password though). Same issue... Traceback (most recent call last): The above exception was the direct cause of the following exception: Traceback (most recent call last): |
I have same problem Error
version
environment
I haven't tried changing the iCloud password yet. |
I tried taking the diffs from ssuchanowski/pyicloud#1 (a pull referenced in that issue) and got the very latest _pysrp.py from https://github.com/cocagne/pysrp/blob/master/srp/_pysrp.py , which includes cocagne/pysrp@8c55b0a It did not help; I still get:
|
One comment suggested that password handling should be different based on the "protocol" used by Apple. Would be great if you can validate on your broken case since both my accounts are working fine with latest srp fixes. |
As a side effect of this I found #1010 :D Conveniently, I didn't have to reset my password to unlock, so I can still try your suggestion. |
OK here's what I did; not that this was after applying the other stuff I mentioned:
And here's the output I got, including from my various print statements:
|
You know I'm not at all certain that the C++ in that post is equivalent to the Python in that post, may look at that more later. |
Oh hey I got it!! The
|
I have some other stuff to do but within a few hours I will have a complete writeup with diffs on what I did. |
OK so big important note is that I'm on the The process I used for the repro/final test is below. podman==docker but better.
Confirmed bad behaviour, copied new file over /usr/local/lib/python3.12/site-packages/pyicloud_ipd/base.py , removed .pyc files, retried; works. The following diffs are a mix of the various things discussed in this thread; I have no interest in figuring out exactly which parts matter, but this definitely works. I expect it also requires srp =1.0.22 to actually work.
|
@rlpowell Right now, I’m on a cruise off the west coast of Africa and will get home 12/7 so wouldn’t be able to do anything until after that. Also, most of my users have experienced constant 503s with the SRP password validation. Rolling back to the old non-SRP version before Apple made the change lets them log in without any problems. Have you see that with your users? |
@gcobb321 I'm not a dev here, I'm just a user who got things working. I have no idea about the 503s. My full base.py is at https://gist.github.com/rlpowell/534558f2dcc474725af56d2868e25f7c |
compiled PR #1014 from that code |
fixed in v1.25.0 |
You’re absolutely right, @rlpowell. Removing the last null termination byte wasn’t necessary. Thanks for spotting this :) |
Overview
401 response when authenticating with version 0.1.24
Steps to Reproduce
0.1.24
icloudpd --username '<email>' --password '<password>' --auth-only
Expected Behavior
Authentication succeeds.
Actual Behavior
Authentication fails with this error message:
Context
I was experiencing the authentication issues described in #970. Tried upgrading to 0.1.24 (which includes a fix for that) but I'm getting another authentication error.
The text was updated successfully, but these errors were encountered: