#135

Poki Setup 0.2.2 (661): repeated 2FA prompt after “code was accepted”

OpeniTryopened 12d ago

What happened

Apple Account sign-in repeatedly returns to the two-factor authentication dialog after a verification code is entered:

Apple asked for a code again after the code was accepted. Try once more.

Cancelling the dialog, starting a fresh sign-in, and entering the newly received code reproduced the same error. Poki Setup still reports signed_in: false. “Code was accepted” is the application’s wording, not independent proof that Apple successfully validated the code.

Expected: a valid verification code completes sign-in, or the application reports the actual validation/session error without repeatedly treating the attempt as accepted.

Account / device context: US-region Apple Account / iCloud account and mainland China market iPhone. Could this combination affect authentication or second-factor selection? This is troubleshooting context, not an established cause.

Possible code-level diagnostic leads

In desktop/core/src/apple/gsa.rs on the inspected main branch:

  • finish() validates the supplied code and calls sign_in() again. If that returns NeedsCode, it emits the error above.
  • check_device_code() falls back to an empty dictionary when plist decoding fails, and defaults a missing ec to zero. This appears capable of treating an unexpected response as successful validation.
  • check_sms_code() checks the HTTP success status without checking the response body for a semantic error.

These are possible leads, not a confirmed root cause. Could validation distinguish a genuinely accepted code from an unexpected response, and preserve or report the new challenge when the subsequent sign-in requests 2FA again?

PR #125 addresses HTTP 503 rejection of Xcode client identities. This report concerns repeated secondaryAuth challenges. Whether that change affects this case has not been tested with a newly built desktop binary.

Privacy

No account identifier, password, verification code, session token, device identifier, phone number, local username/path, original screenshot, or raw diagnostic attachment is included.

Steps to reproduce

  1. Open Poki Setup and select Apple Account.
  2. Enter the account credentials and start sign-in.
  3. Enter the verification code received for this attempt.
  4. Observe the error above and another code prompt instead of a completed sign-in.
  5. Cancel and restart sign-in; the same behavior recurs.

Reproduced multiple times, including a fresh sign-in attempt. Exact app uptime was not recorded.

Area

Install or signing (Poki Setup, iLoader, refresh)

App version

Affected desktop app: Poki Setup 0.2.2 (661); selected channel: Stable. iPhone app installation not completed.

Installed with

Poki Setup 0.2.2 (661) on macOS, Apple Silicon (arm64). Developer account type and exact macOS version not recorded.

iPhone and iOS

Mainland China market iPhone; exact model and iOS version not recorded. Failure occurs during Apple Account sign-in on the Mac.

Debug log

Sanitized excerpt; timestamps and account/device identifiers omitted. This sequence recurred:

sign-in answered hsc 409 au Some("secondaryAuth")
trusted-device code requested (HTTP 200 OK, approximately 66 KB response)
2FA info answered HTTP 200 OK
SMS request PUT answered 405 Method Not Allowed
SMS code requested (POST, HTTP 200 OK)

No response bodies are included. Response size alone does not establish whether the response was valid or an error page. The HTTP 405 is followed by a successful HTTP status on the POST fallback, so it is not presented as the confirmed cause.

Activity

3
JosssphZhou11d ago

We have read the report and checked the current authentication code. #125 is merged (a22435f6), but it normalizes the Xcode client identity at the GSA request boundary; it does not fix the repeated secondaryAuth challenge path. In finish(), a second NeedsCode still becomes the quoted error. The trusted-device parser still defaults an undecodable response or missing ec to success, and the SMS validator checks HTTP status only. Those are valid diagnostic leads, not proof that Apple accepted the code or that account/device region caused the loop.

Please share the exact Poki Setup build and macOS version for a fresh attempt, whether the requested factor was a trusted-device notification or SMS, and whether the same loop occurs in a build containing #125. We cannot name a release that fixes this loop yet. Please do not post credentials, verification codes, authentication headers, raw response bodies, or device/account identifiers.

JosssphZhou8d ago

Thanks for the login diagnostics. #233 improves trusted-device response handling, while #309 covers a separate part of the Apple sign-in flow. Neither currently proves that the repeated secondaryAuth behavior is fixed. When retesting, please share only the app build, macOS version, authentication method, and sanitized error stage, without account credentials, codes, or full authentication payloads.

JosssphZhou3d ago

Poki Setup 0.2.7 is out for macOS and Windows and fixes the repeated verification code prompt: the code is now accepted on the first try, including codes Apple pushes to your devices by itself. Download it from the latest release on the Releases page. If it still asks again after an accepted code, please reply here with your Poki Setup version and whether the code came by push or SMS.