-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2FA element targets specified in src/var.py aren't on current login flow page #226
Comments
Hey @rossry thanks for the detailed bug description and for suggesting the fix. You're correct, it seems that the website has changed - that happens sometimes and we need to adjust the variables to match it. Setting env var:
Should fix the issue. Annoyingly, IBKR sometimes rolls out different versions of their website to different users (I guess based on geography), hence I'm currently reluctant to modify these vars straight away. However, this seems to be the problem also described in other issues previously: #198 #217 Seeing that this is a repeated problem, I'm going to modify these variables permanently, hoping that this is a consistent change for us all. I'll update this issue when this change is rolled out, while for now you can fix it by setting the env vars above.
Sadly yes, it is not possible.
If they haven't changed too much I think it should be fine. That has always been the case. |
Appreciate the snappy response! Setting those env vars got me further, but uncovered a second apparent issue -- it looks like Logs (example at bottom of message) now suggest that the login logic is recognizing that 2FA is required and is proceeding to calling Hypothesizing further, I'd hazard a guess that the page at If that's right, then I'd guess that line 56 and 62 should change to instead use a new I'd write the PR, but I've only been running the containerized version for now so it's not trivial for me to play around and check whether it works.
|
More generally (and feel free to move this to another ticket), I do wonder how much it would be possible to have records of what a webdrivered page (IB's, or in this case Google's) is supposed to look like, and raise a more pointed message to the user about what is going on if it's clear that the page has been changed. Not sure exactly what the logical check would look like, but surely something is possible here. (Even better would be testing to autonomously raise an alert about key page changes as an issue in github.) |
hey @rossry thanks for pointing all of these things out. Let me address them. To start with:
If you'd like to play around and check whether it works on your own within a containerised deployment, you can provide a modified version of this Google Msg Handler as a Custom Handler. Just copy paste the code to a new file, modify it, provide it through Inputs Directory and tell IBeam to use it by setting My IBKR account doesn't use SMS authentication so I won't be able to do any tests on these fixes.
Possibly, yes. It's not the first time, and it's expected this would happen every now and then 🤷♂️ We just gotta step in and fix it.
I appreciate you going into this length to explain what needs to be changed. I've attempted implementing the first step by adding: pair_button_present = EC.presence_of_element_located((By.CLASS_NAME, 'use-without-account-link'))
WebDriverWait(driver_2fa, 240).until(pair_button_present)
pair_button_el = driver_2fa.find_element(By.CLASS_NAME, 'use-without-account-link')
pair_button_el.click() After we open the webpage. You can test it in The next steps aren't very clear to me, sorry. Would you be able to bulletpoint each change you require to make? Or feel free to post the modified code and I can publish a release candidate with it for you to test.
Yes, this is not a bad idea. For Google Messages this would work better, since IBKR changes its webpage depending on the type of 2FA you have enabled, and there's at least 3 different ways to do this. Furthermore, for this to be an CI/CD-type action there would need to be someone's credentials made available to carry out the authentication flow automatically. Nevertheless, doing just the basic login page wouldn't hurt. I don't have the resources to implement it at the moment, would you be interested in contributing it? |
Describe the bug
The element targets specified in
src/var.py
don't seem to appear on the login flow page for users with a SMS security code. (Perhaps the page has been updated?) This causes the login attempt to timeout instead of proceeding tostep_two_fa_notification()
.src/var.py
has:but my manual login attempt gives me a page with this element for the input box (see also screenshot):
To Reproduce
Steps to reproduce the behavior:
IBEAM_TWO_FA_HANDLER=GOOGLE_MSG
andIBEAM_TWO_FA_SELECT_TARGET=One Time Passcode
.I|Submitting the form
toE|Timeout reached when waiting for authentication.
Expected behavior
Observe a "Web messages is not authenticated..." message (when running with
GOOGLE_MSG
for the first time) as claimed on the wiki. (Afterwards, use that handler to get the 2FA code from the message and use the code to login.)Environment
IBeam version: 0.5.5 (from
docker pull voyz/ibeam
)Docker image or standalone: Docker image
Python version (standalone users only): []
OS: Ubuntu 22.04.1 LTS
Additional context
I am hoping to get the
GOOGLE_MSG
2FA logic set up in a docker instance, using the code from an SMS message to login. I understand that it's not possible(?) to set an login back to SMS auth after setting it to app-based auth, so I'm using a fresh secondary login (created with effectively read-only permissions on my trading account) that has defaulted to SMS auth.Suggest a Fix
I suspect that
ibeam/src/var.py
should be changed at lines including (but perhaps not limited to?):TWO_FA_EL_ID
on line 155TWO_FA_NOTIFICATION_EL
on line 158TWO_FA_INPUT_EL_ID
on line 161but I don't feel familiar enough with the codebase to suggest what good target specifications should be.
Additionally, it appears to me that the login flow page has elements for all 2FA status possibilities in the DOM, just with
display:none
. I'm not sure whether this is a problem for the search strategy?The text was updated successfully, but these errors were encountered: