Summary
Accounts with IB Key (mobile 2FA) enabled cannot connect. After SRP authentication completes, the IB server enters a second-factor challenge loop sending type-530 keepalive messages while waiting for IB Key approval on the user's mobile device (notification is never received). ibx has no mechanism to participate in this challenge, so the post-auth phase times out with "Never received data start after auth" (gateway.rs:592).
Current State
| Aspect |
Status |
| SRP auth (username + password) |
Works — do_srp completes, session token obtained |
Soft token challenge (farm-level 35=S) |
Works — do_soft_token responds to farm auth challenges (gateway.rs:188) |
| IB Key 2FA (login-level) |
Not supported — server sends NS keepalives (type 530), ibx loops until timeout |
| Paper accounts (no 2FA) |
Works — full connection including all farms |
What Happens
- SRP authentication succeeds,
NS_CONNECT_RESPONSE (type 523) is received
- Port type change is sent, server acknowledges
- Instead of
NS_FIX_START (type 525), server sends repeated type-530 messages — these are keepalives while IB waits for the user to approve the login on their mobile IB Key app (mobile notification never received)
- The post-auth loop in
gateway.rs:540–594 doesn't recognize these as a 2FA challenge and logs them as "Post-auth msg type=530"
- After the loop exhausts its iterations, it returns
"Never received data start after auth"
What Was Tried
- Adding
FLAG_SOFT_TOKEN to connection flags — server rejects; SOFT_TOKEN (xyz.rs:14) is for farm-level XYZ auth challenges, not the initial login 2FA gate
- Proactively sending a
SOFT_TOKEN init — server rejects this as well
What's Needed
IB Key 2FA is a server-side push notification flow. The server waits for the user to tap "approve" in the IB Key mobile app. ibx needs to:
- Detect the 2FA-pending state (type-530 keepalives after
NS_CONNECT_RESPONSE but before NS_FIX_START)
- Active the push notification to the user
- Wait with periodic keepalive responses until the user approves (or a configurable timeout)
- Resume normal post-auth flow once
NS_FIX_START arrives
Summary
Accounts with IB Key (mobile 2FA) enabled cannot connect. After SRP authentication completes, the IB server enters a second-factor challenge loop sending type-530 keepalive messages while waiting for IB Key approval on the user's mobile device (notification is never received). ibx has no mechanism to participate in this challenge, so the post-auth phase times out with
"Never received data start after auth"(gateway.rs:592).Current State
do_srpcompletes, session token obtained35=S)do_soft_tokenresponds to farm auth challenges (gateway.rs:188)What Happens
NS_CONNECT_RESPONSE(type 523) is receivedNS_FIX_START(type 525), server sends repeated type-530 messages — these are keepalives while IB waits for the user to approve the login on their mobile IB Key app (mobile notification never received)gateway.rs:540–594doesn't recognize these as a 2FA challenge and logs them as"Post-auth msg type=530""Never received data start after auth"What Was Tried
FLAG_SOFT_TOKENto connection flags — server rejects;SOFT_TOKEN(xyz.rs:14) is for farm-level XYZ auth challenges, not the initial login 2FA gateSOFT_TOKENinit — server rejects this as wellWhat's Needed
IB Key 2FA is a server-side push notification flow. The server waits for the user to tap "approve" in the IB Key mobile app. ibx needs to:
NS_CONNECT_RESPONSEbut beforeNS_FIX_START)NS_FIX_STARTarrives