boredazfcuk / docker-icloudpd

An Alpine Linux container for the iCloud Photos Downloader command line utility
1.58k stars 149 forks source link

Token expiring early/no renewal notice sent #524

Closed ryan-adler closed 3 months ago

ryan-adler commented 3 months ago

I have noticed that my token seems to expire after (around?) 30 days, not 3 months, as stated in the configuration docs. I only know that it has expired because I start to get notifications on my phone that I need to allow the login. The container itself, though, does not realize that the token has expired, and hangs on: Fetching libraries list...

boredazfcuk commented 3 months ago

If I check the X-APPLE-WEBAUTH-HSA-TRUST section of my cookie, which is when the MFA expires, I can see mine expires in 65 days time.

The cookie looks a lot different it the last time I looked at it though. Previously there were only 2 or 3 sections. Seems a lot more now though.

I guess that I'll find out if the behaviour is the same in 5 days time, as I'll hit the 30-day mark then. Not that I'll be able to do anything about it as my laptop isn't booting anymore.

boredazfcuk commented 3 months ago

So, my cookie expired today. Looks like Apple must have reduced the cookie timeout to 30-days after all. Thanks for bringing this to my attention.

boredazfcuk commented 3 months ago

I've changed the script so that it checks a different expiry date within the container. This will now recognise the 30-day timeout and send out notifications on day 21.

I've also added the capability to remotely re-authenticate using Telegram and also created a new reauth.sh script to quickly re-enter the MFA code from the container command line. See the CONFIGURATION.MD file for further details.