-
Notifications
You must be signed in to change notification settings - Fork 55
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
Pyicloud SRP i code #381
Comments
Spotted it I think == need to json.dumps(data) or use json= But - had written this before double checked: This changes have been integrated in pyicloud - which is similiar to our code if helps troubleshooting here: I would be concerned may be version of the srp library - and would see if can log details of it? |
I was setting data to json.dumps(data) in the post routine in PyiCloudSession in my original code, not the new code. Changed that and I’m now logging on and getting 6-digit code needed. The code is not accepted so I still have a little work to do that is probably unrelated. Great spot. Thanks Have you seen any email notifications from Apple about logging into your account after the SRP implementation? |
No - haven't had any email notifications...interesting... Code is working for me (with same url as previously) Issue still is authenticating at Find service (with 450 - which then wants to redo everything multiple times and then fails.) |
I should mention that I made a mistake at:
Should be:
The srp part should be fine once I am using |
I should know more about the 421/450 after iCloud3 runs for a while. iCloud3 is running like it did last week. |
Great news. Will wait for you to commit upload changes and will compare Glenn |
I’m getting a 450 (reauthentication via token) followed by lots of 500’s (refresh client) before a 200. Blew up my log file and my vscode running as a browser on my iPad can’t handle the file size. Will get into my computer later. |
Probably similar to what I’m seeing. The FMIP service refreshclient causes a 450 - which in session or base (depending on age of pyicloud base) sets up a full authenticate again (which now does the SRP exchange). This completes successfully - again, but next FMIP refresh client again causes 450, full refresh and on and on . May not be my code after all. The Web Browser development tools - when going from icloud to Find shows this flow seems correct. Once logged in via init/complete SRP exchange, and then If go to Find - does a new init/complete and then accountLogin before - refreshClient succeeds. Possible missing the last accountLogin - Sorry checked again and and this is the _authenication_token - call so does follow the Web. Potentially something has changed in this? That means FMIP refreshclient keeps failing. ?dsid ?other. Back to check tomorrow. |
@PaulCavill |
@gcobb321, I believe once the change is made to the main icloud hass intergration, it will be available but for now i've had to do the same workaround to get it functioning. I’ll submit a PR today and hopefully the current maintainers will review and merge it. |
Have fixed the 450 repeats that I was seeing, somewhat quickly this morning pending further tests- and re checking the 2FA code path when have time hopefully later today. Current given existing token now connects without 450 repeated errors. Will fine tune the initial connection - as the change I made below may impact. Seems to relates to the self.authenicate_token call timing at the end of authenticate. Fix: Presume this /accountLogin self.authenicate_token call immediately before repeated fmip refreshClient call - leads to the 450 refreshclient repeats. |
@gcobb321 My PR for icloud in Home Assistant core got rejected, they have stated picklepete/pyicloud needs to be fixed to solve the issue. There's already an open PR, so I've tagged the maintainers to try and get some movement. It looks like you've contributed to this project before, so you might know who to reach out to. |
@Ghawken I've inserted this in the Session request function right before the
|
@gcobb321 But I suppose I’m missing - where are you validating the token? My approach was to modify authenicate.: Seems to be working ok in pre-release testing. Both probably do the same - not entirely sure what is more pythnotic …. |
@Ghawken @iowk
I’ve created a new issue away from the iCloud3 users posting their status.
I’m having a problem integrating the new authorize_with_password code into iCloud3 running under Home Assistant. I can get @iowk’s code running stand alone but keep running into a problem on the first init transaction to
https://idmsa.apple.com/appleauth/auth/signin/init
. The response is empty so there is no data/body[ ‘salt’] value to use later on. I have verified that the url, data and header values are the same except for a, the session_id, and token values between the HA and standalone program running under vscode.The result in getting is
My code:
SRP is not in the standard HA library so I have had to add it to a HA manifest.json file as a requirement which gets processed at load time to add it to the site-library. I do not know what version is loaded. I’m running on a Raspberry Pi with their own OS.
Any thoughs would be appreciated on where to look or what might be wrong.
a
is not getting seeded properlyI’m running Python 3.13,
Thanks
The text was updated successfully, but these errors were encountered: