-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix TAN request with response code 3955 during initialization of the dialog #171
Conversation
Thanks a lot for this. This fixed the problem for me with "Erzgebirgsparkasse". The second problem is that I now need to confirm the python script as a new device on my bank account every time. |
This might be for this reason: Anyone interested in creating a PR to support persisting a device ID? |
Okay turns out this is already implemented. What you need to do is, at the end of your script, save the value of |
Thanks, I will try that in the coming days and report back. Sounds reasonable.
Related to that: Would it be reasonable to send the empty string instead of |
I tried and could retrieve and store the It cannot be passed to the constructor of However, the following exception is triggered then during the very first response triggered by entering the
I guess the relevant part of the response is
and many more segments. |
…_bootstrap if client.selected_tan_medium is already defined
The
|
Here's a patch for adding the system ID in the constructor: #172 |
Thank you for the fix! After applying the changes in the commits and adding the following lines:
I am no longer encountering any errors with Nassauische Sparkasse and Sparkasse Langen-Selingenstadt. I also tried including the system ID in the constructor as suggested, but it doesn’t seem to be working, I also get the same problems as mentioned by @meyerj. Do you have any further suggestions? |
I can now finally reproduce this with my Sparkasse, but this PR doesn't fully fix it for me, digging deeper… |
Okay, I can fix it for me with a further change I'll push after merge of this |
Thanks! Version 4.2.0 works for me if I pass the |
This patch fixed a similar issue as in #155 for me with the "Sparkasse Vorderpfalz": Since a few days a push TAN is required even to request an account balance or get transactions of the last view days. Before, this was working with only the PIN.
I tracked the issue down to two issues by debugging the exchanged messages as described in the documentation, for which I propose a fix here.
The string
"DUMMY"
sent as thetan_medium_name
was somehow rejected by the bank. Even the call toclient.get_tan_media()
inminimal_interactive_cli_bootstrap()
already triggered the error as described in DKB does not accept connections anymore #121, with the first response beingfollowed by
after the subsequent call to
client.get_sepa_accounts()
(HKSPA1
), likely because the dialog was never actually accepted by the server. Should a 9xxx response code already trigger an exception inFinTSDialog.init()
?Sending an empty
tan_medium_name
works and triggers the response in the next bullet point. So I setclient.selected_tan_medium = ''
before callingminimal_interactive_cli_bootstrap(client)
to already skip the call toget_tan_media()
(with my patch). I guess this only works because there is only one for my account. I tried different strings, the name of my device and the UUID shown in the Push Tan app in "Verbindungen", nothing worked. And evenget_tan_media()
requires a TAN when the dialog starts, so it is a kind of chicken-and-egg problem and I have not found a way to not add the HKTAN7 segment to the dialog initialization request triggered byget_tan_media()
.With the empty
tan_medium_name
the bank server responds with a TAN request and code 3955. That was added in Fix #155 -- Implement HKTAN7 and decoupled TAN process #162 to the client's_send_with_possible_retry()
method to react on a TAN request when sending a request after the dialog has been established, but not inFinTSDialog.init()
if the bank already sends that response:So I assume it was an oversight in Fix #155 -- Implement HKTAN7 and decoupled TAN process #162 to not also patch the other method?
So these two changes work for me with an application similar to the one in the troubleshooting guide. I have not found a way to retrieve transactions without having to confirm that with a push TAN via the app interactively. Ideally there would be a way to remember that "device" at least for a couple of days, like it also works with interactive logins via the web page.
This patch may resolve #121 and #165, at least when also setting
selected_tan_medium
to an empty string (or something else if you already know a valid value) before the call tominimal_interactive_cli_bootstrap(f)
: