Skip to content

fix: fall back to legacy Store authentication - #514

Merged
majd merged 2 commits into
majd:mainfrom
bboy910225:agent/legacy-auth-fallback
Aug 3, 2026
Merged

fix: fall back to legacy Store authentication#514
majd merged 2 commits into
majd:mainfrom
bboy910225:agent/legacy-auth-fallback

Conversation

@majd

@majd majd commented Jul 25, 2026

Copy link
Copy Markdown
Owner

This pull request improves the App Store login flow by adding robust handling for legacy authentication fallbacks and better error reporting when Apple returns unexpected responses. It introduces a new error type to capture non-XML or empty responses, ensures the correct request payload is preserved during redirects, and updates tests to cover these scenarios.

App Store login improvements:

  • Added fallback logic in appstore_login.go to retry login with the legacy authentication endpoint (legacyAuthenticateEndpoint) when the native endpoint returns specific HTTP errors or empty responses. [1] [2] [3]
  • Ensured that when following authentication redirects (such as to Store pods), the original XML plist request body and its attempt value are preserved. [1] [2]

Error handling enhancements:

  • Introduced a new UnexpectedResponseError type in client.go to capture HTTP status and response snippets when Apple returns an empty or non-plist body.
  • Updated the XML response handler to return this error type and to preserve redirect responses and their headers for callers.

Test coverage:

  • Added and updated tests in appstore_login_test.go and client_test.go to verify fallback to legacy authentication, correct handling of redirects, and preservation of request bodies and headers. [1] [2] [3]

@majd

majd commented Jul 25, 2026

Copy link
Copy Markdown
Owner Author

@Horskin Can you fix the linting issues so we can get this merged?

@tux-mind

Copy link
Copy Markdown
Contributor

bboy910225#1

@iossp-vn

Copy link
Copy Markdown

Idk why, but whether I use an ID with or without 2FA, I still can't log in. When I tried with an ID (no 2FA), it still asked me for a 2FA code.

@majd
majd merged commit ab79e42 into majd:main Aug 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants