[BUG] CAA TOTP verification returns HTTP 200 without a completed login session in 3.0.4
What broke?
With instagrapi 3.0.4, my login reaches two-factor verification, but submitting an authenticator-app code returns HTTP 200 with provider status ok and no completed login session recognized by the integration. I approve the login notification in the official Instagram app before entering the code. This was reproduced through ViewNook's client wrapper; I have not independently reproduced it with an unmodified instagrapi.Client.
Affected area
login / challenge
Minimal reproduction code
An independently verified, standalone reproduction is not yet available. The affected integration is private and its repository cannot be shared. The snippet below illustrates only the public instagrapi 3.0.4 helper sequence used for continuation; it does not include the integration's implementation or reproduce its configuration.
The observed steps were: submit username/password locally, approve the phone notification, select authenticator-app verification, and submit the code through a hidden local prompt. The integration calls `login(username, password)` once, catches `TwoFactorRequired`, then resumes on the same client using the returned context. No credentials or context values are included here.
# Illustrative sequence, not a runnable standalone reproducer.
# cl: existing client; context: returned challenge context;
# code: authenticator code supplied locally by the account owner.
cl.bloks_two_step_verification_entrypoint(context)
cl.bloks_two_step_verification_method_picker(context)
cl.bloks_two_step_verification_select_method(context, selected_method="totp")
result = cl.bloks_two_step_verification_verify_code(context, code, challenge="totp")
The code is submitted once; the CLI does not restart password login after that submission. The sequence above has not been independently live-tested with an unmodified client.Full traceback
No traceback. The CLI catches the exception and prints this sanitized diagnostic:
Bridge: Instagram returned no completed login session for that verification. This login was not restarted. Diagnostic: stage=two_factor_verify category=two_factor type=TwoFactorContinuationError httpStatus=200 reason=no_login_payload method=totp payload=object providerStatus=ok signals=action,verification referencedApps=verify_code contextSource=action contextIndex=0
`TwoFactorContinuationError` is an integration wrapper exception, not an instagrapi exception.Observed result
The verification response is HTTP 200 with provider status ok. Its Bloks action references com.bloks.www.two_step_verification.verify_code.async, but the SDK's embedded-login parser and the wrapper's current-response authorization/cookie checks do not yield a completed session. The sanitized scan reports no recognized login marker, authorization header, or nonempty session cookie.
Login stops without saving a new session. HTTP 200 and the action reference do not establish whether Instagram accepted the code, rejected it, or requires another step.
Expected result
If verification completes, the flow should produce an authenticated session. If Instagram rejects verification or requires another step, the client should expose that error or required continuation rather than leave the response unresolved.
instagrapi version
3.0.4
Python version
3.12.14
Operating system
macOS 27.0, arm64
Login method
username/password
Proxy used?
No
Can you reproduce on current master?
yes
Raw API response or payload sample
The raw response was not retained. This is a **derived, allowlisted diagnostic summary**, not raw API JSON:
{
"stage": "two_factor_verify",
"category": "two_factor",
"type": "TwoFactorContinuationError",
"httpStatus": 200,
"reason": "no_login_payload",
"method": "totp",
"payload": "object",
"providerStatus": "ok",
"signals": ["action", "verification"],
"referencedApps": ["verify_code"],
"contextSource": "action",
"contextIndex": 0
}Additional context
- The wrapper changes retry behavior, context extraction, diagnostics, and credential application. It uses the SDK's curl HTTP/2 private transport with TLS verification, disables automatic retries, and checks credentials issued by the current response. These differences mean an upstream defect is not yet established.
- An offline comparison found that all four generated endpoint, parameter, and header-override calls match
Client._login_with_bloks_two_factorin 3.0.4 for the same synthetic context and settings. This fixture comparison does not establish the cause of the live failure. - Related: issue #2800. Its explicit
CAA_LOGIN_FALLBACK:fallback_triggeredfix, PR #2803, shipped in 3.0.3 and is already present in our installed 3.0.4. My latest failure occurs after TOTP submission, so I am not claiming this is the same issue. Our diagnostics do not establish whether that fallback marker exists in the unretained verification response. - Separately, browser-session import did not provide usable mobile access: profile retrieval passed, feed access failed, and a later authenticated current-account check returned HTTP 403
login_required. This is a separate observation, not proof of the TOTP failure's cause. - Is this a known continuation unsupported by the current helper sequence? Which nonsecret structural fields would help distinguish code rejection from an additional required step?
Source: subzeroid/instagrapi