Repository navigation
fix: use JSON endpoints for SMS verification - #62
Conversation
|
removed the simulated test harness. the seven scenarios previously reported used a stubbed transport and do not establish compatibility with apple. validation is limited to syntax and diff checks; real sms delivery, code verification, and sign-in remain untested. the full build attempt stopped at the missing OpenSSL.xcframework dependency. this remains a draft candidate, not a confirmed fix. |
An account with no trusted device gets "au" = "secondaryAuth" from GrandSlam. AltSign only knew trustedDeviceSecondaryAuth, so it treated the account as having no 2FA and the sign-in failed later. secondaryAuth now requests the code by SMS and validates it with the JSON endpoints that rileytestut/AltSign#62 proposes and isideload uses: PUT /auth/verify/phone {"phoneNumber":{"id":1},"mode":"sms"}, then POST /auth/verify/phone/securitycode with the code. Content-Type and Accept are application/json. Like isideload: - phone number id 1, the account's first trusted number; - HTTP 412 with an unlocked challenge, or serviceErrors -22979/-22981, means a code was already sent and is still valid, so no new one is requested; - -21669 is an incorrect code; - any 2xx answer to the code counts as success, and sign-in then runs again with fresh anisette data, as for trusted-device codes. Other serviceErrors are surfaced with Apple's message. The headers shared with trusted-device 2FA move into TwoFactorHeaders(). The SMS validation uses refreshed anisette data, since typing the code can outlast the one-time password. Not yet tried against Apple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An account with no trusted device gets "au" = "secondaryAuth" from GrandSlam. AltSign only knew trustedDeviceSecondaryAuth, so it treated the account as having no 2FA and the sign-in failed later. secondaryAuth now requests the code by SMS and validates it with the JSON endpoints that rileytestut/AltSign#62 proposes and isideload uses: PUT /auth/verify/phone {"phoneNumber":{"id":1},"mode":"sms"}, then POST /auth/verify/phone/securitycode with the code. Content-Type and Accept are application/json. Like isideload: - phone number id 1, the account's first trusted number; - HTTP 412 with an unlocked challenge, or serviceErrors -22979/-22981, means a code was already sent and is still valid, so no new one is requested; - -21669 is an incorrect code; - any 2xx answer to the code counts as success, and sign-in then runs again with fresh anisette data, as for trusted-device codes. Other serviceErrors are surfaced with Apple's message. The headers shared with trusted-device 2FA move into TwoFactorHeaders(). The SMS validation uses refreshed anisette data, since typing the code can outlast the one-time password. Not yet tried against Apple.
Bumps upstream_repo to ac02e35 (AltServer-Windows branch sms-2fa): GrandSlam's "secondaryAuth" now gets an SMS code through the JSON endpoints from rileytestut/AltSign#62 and isideload, instead of being mistaken for an account without 2FA. README-NG documents it as Fix 7, experimental until it has signed in against Apple. Built for x86_64; not yet tried against Apple.
|
Data point for these JSON endpoints against Apple, from a C++ port of the same flow in my AltServer-Linux fork (AltSign as vendored in AltServer-Windows, not AltStore itself). Tested 2026-11-05 with a free Apple ID whose 2FA was SMS only (no trusted devices at the time), Mac anisette. The endpoints work:
Two things that cost me a failed attempt each, in case they matter for this PR:
C++ implementation, if useful for comparison: https://github.com/jaakkopalvaila/AltServer-Windows/blob/5224db7b0c19015126ff678c88b83a3cbfeecd42/AltSign/AppleAPI%2BAuthentication.cpp ( |
|
Thank you so much for this! I've confirmed it works to sign in with my test Apple ID that had this issue, will release an update with this fix soon. |
sms verification in altserver 1.8.2 and altstore classic fails with http 415 in altstoreio/AltStore#1844. the current client posts an xml plist to
/auth/verify/phone/put?mode=sms.this switches sms delivery to
PUT /auth/verify/phonewith json and code verification toPOST /auth/verify/phone/securitycodewith nestedphoneNumberandsecurityCodeobjects. both requests explicitly advertiseapplication/jsonfor content-type and accept. trusted-device requests retain their existing format.the wire format follows isideload's sms flow and its sms headers.
validation is limited to swift frontend parsing and
git diff --check. no real sms delivery, code verification, or apple sign-in has been tested.draft: no end-to-end apple sms sign-in has been tested. this is a protocol-alignment candidate, not a confirmed resolution of #1844. the existing phone-id-1 selection and PE-token success check are unchanged and also need validation with an affected account. no credentials were used in the checks.