Support IBKR second-factor device selection and manual 2FA fallback#277
Open
onurserce wants to merge 2 commits intoVoyz:masterfrom
Open
Support IBKR second-factor device selection and manual 2FA fallback#277onurserce wants to merge 2 commits intoVoyz:masterfrom
onurserce wants to merge 2 commits intoVoyz:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR solves issue #271 by improving the IBKR login flow for accounts that do not go directly from username/password to a standard 2FA screen.
It adds support for:
Select Second Factor DevicedropdownIt also updates the docs and provides a tracked
env.list.exampletemplate for compose-based setups.Problem
Some IBKR accounts now show an extra device-selection step after submitting credentials. The existing flow did not expect this intermediate screen, and the default selector for
TWO_FA_SELECTwas incorrect for that page.A second issue is that some variants do not navigate to a separate OTP page after device selection. Instead, they stay on the same login form and reveal a code input such as
Mobile Authenticator App Code.Finally, users with device-bound authenticators may have no usable automated
IBEAM_TWO_FA_HANDLER, so the current behavior shuts IBeam down at the 2FA step even though the login could still be completed manually.Changes
Login flow
TAG@@selecttargets so the second-factor device dropdown can be identified reliablyIBEAM_TWO_FA_SELECTPLACEHOLDER@@Code) for same-page OTP variantsIBEAM_MANUAL_TWO_FA=trueand no automated 2FA handler is configuredConfig and safety
IBEAM_MANUAL_TWO_FAIBEAM_MANUAL_TWO_FA_TIMEOUTIBEAM_TWO_FA_SELECT_EL_IDandIBEAM_TWO_FA_SELECT_TARGET(in case the user enters the environment variables in quotes)Docs
env.list.examplefor clarity, keep localenv.listignoredExample runtime output
The following log sequence shows the intended behavior for the
Mobile Authenticator Appflow with manual fallback enabled:Configuration example
For accounts that show the extra device-selection step and require manual completion of 2FA:
Verification
Tested locally by rebuilding the Docker image and exercising the login flow against an IBKR account that shows:
Select Second Factor DeviceMobile Authenticator AppCode