-
Notifications
You must be signed in to change notification settings - Fork 182
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
Does not work when you have 2FA setup for more than 1 device, eg IBKR SecureCard & mobile app #118
Comments
It should be perfectly possible for IBC to intercept this selection dialog, and to choose the IB Key option. I need you to run IBC with But before I commit to do this, can I ask why not just always use IB Key? Why do you need more than one 2FA method? The reason I ask is that I'm wary of doing this, since it's yet more IBC dependence on recognizing strings that IB define and that they could change at any time. I suppose the answer to that would be that the user is responsible for putting the actual selection string they want in config.ini, and IBC can then be totally unintelligent about it - if it can't find the string in the list, just leave the dialog on display and let the user choose or correct the entry in config.ini and restart. |
Hi, thanks for reply. Reason for 2 2FA methods is that I normally use FaceID on the IBKR mobile app but have a SecureCard stashed away as backup.
I will send the info you request shortly. I think the dialog always shows the methods in the same order so you could just instead of detecting an exact string match have the 1st or 2nd entry selected.
On May 8, 2021, 10:27 AM -0700, Richard L King ***@***.***>, wrote:
It should be perfectly possible for IBC to intercept this selection dialog, and to choose the IB Key option. I need you to run IBC with LogComponents=yes in config.ini, which will log the details of the dialog's structure so I can work out how to recognise it (the fact that it has the same title as the 'normal' Second Factor Authentication dialog is not helpful...). Post the IBC log file containing the information here (but attach it, the whole thing, don't quote it).
But before I commit to do this, can I ask why not just always use IB Key? Why do you need more than one 2FA method?
The reason I ask is that I'm wary of doing this, since it's yet more IBC dependence on recognizing strings that IB define and that they could change at any time. I suppose the answer to that would be that the user is responsible for putting the actual selection string they want in config.ini, and IBC can then be totally unintelligent about it - if it can't find the string in the list, just leave the dialog on display and let the user choose or correct the entry in config.ini and restart.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#118 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB63WUZ56X45OORWBLHCMWDTMVYA3ANCNFSM44LFZSSQ>.
|
HI @rlktradewright. |
Thanks for the logfile, but this doesn't seem to me to be the same situation. It's only offering you one option 'One Time Passcode', and it's not clear to me what actually should happen if you proceed with that. I presume you did click OK, and it sent a prompt to your phone, but then it crashed? Is this is a change in behaviour by TWS, or have you only just started using the IBKR Mobile app for 2FA? I suspect (without actually looking at the code) that the crash is because you manually clicked OK rather than IBC clicking it, and so it didn't record the time that OK was clicked and then couldn't do a necessary calculation: if so, this is clearly a bug in IBC and I'll fix it. But as it happens, I'm unwell at present and not really in a fit state to move this forward, so please be patient. In the meantime, it would be helpful if you could upgrade to the current 'stable' TWS, which I think is 981.3c, just in case this is a result of using an out-of-date TWS (I suspect it'll behave just the same, but it's worth knowing for sure). |
Hi @rlktradewright.
Yes, it was some kind of bug. Usually it succeeds and opens the terminal.
I have several accounts and other accounts without 2-nd 2FA device work fine.
Hope you are OK and get well soon.
I am specially using 927 version of TWS to keep "overnight alive" feature. Thanks. |
Sorry for the delay in progressing this. I'm gradually recovering from my ailment and should be able to spend more time on it now. The last logfile you sent was interesting (and unexpected) in that it didn't include the details of the entries in the 'Select second factor device' list. I've made a change to the window handling in IBC that I hope will resolve this problem. I've created a new zip file for IBC v3.11.0-beta.1 which contains this version. Please just copy the https://1drv.ms/u/s!AlqfLEOWDJ9Zh94157CLRVqRJEcGhg?e=kLjnMN. I've understood the cause of the crash last time, but haven't included a fix for it here because I actually want it to crash after displaying that dialog and clicking ok (and I don't have enough information yet to do a proper fix). |
Can someone please try the version referred to in my previous post so I can hopefully get better information? I can't progress this until I have proper information about the structure of the device list. |
Hi @rlktradewright |
@lexasoft123 thanks for that. I now realise where I've gone wrong and will offer you another beta within the next couple of days. |
Sorry for the delay with this: I completely forgot about it! A new beta (3.12.0-beta.1) is now available here: https://1drv.ms/u/s!AlqfLEOWDJ9Zh-VR6YgCu5DqFbtBCw?e=FlqSkv With any luck this should do the job. There is a new setting in If the 'Select second factor device' dialog is displayed:
|
@rlktradewright Hi!
|
This is very weird that it can't find that entry in the list, since it has just printed out the contents and that entry is definitely there. I suspect that the list entries contain some unprintable characters, so that what's visible is not exactly the same as what's actually in the entry. To get some extra diagnostics I've produced 3.12.0-beta.2 which prints the contents of each list entry in both characters and hex while it's searching for the required entry. If that doesn't show up the problem I'll have to shut myself in a darkened room with a couple of very long gin and tonics... |
Looks like there is a space before the label? |
Well it's a relief to know that! I guess I should have thought of removing leading and trailing spaces from the list entries, but it simply never occurred to me. I'll get you another version tomorrow, and hopefully it will do the job. |
I think better to look for a substring in the label. |
I considered that suggestion but I think just copying the full value verbatim into config.ini is a simpler rule. Here's the latest: https://1drv.ms/u/s!AlqfLEOWDJ9Zh-VTubFGKtHrEb4oGA?e=jzc15o I've left the extra diagnostics in for now, but will remove them for the release version. |
Hi @rlktradewright |
Glad to hear it. |
Apologies, I just realised that I haven't put this into a released version. Unfortunately Release 3.12.0-beta.1 published yesterday doesn't contain this fix. I'll put out another release to correct that soon. |
This was fixed in IBC 3.12.0-beta.2 |
@rlktradewright sorry to have never followed up after I opened this 2 years ago but I can confirm now this is fully working. |
In this case IB Gateway shows an extra dialog to choose the 2FA device you want to use, see screenshot from a remote VNC viewer connected to IBC running inside Docker. Seems this dialog should be detected and a config setting added that fixes which security device to use (select 1st, 2nd, ... in the select window). How can this be added?
This is the console output:
and it gets stuck here.
I'm happy to test things if you can't replicate this because you don't have multi-device 2FA on your account.
Pls advise.
The text was updated successfully, but these errors were encountered: