You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
DKB moved their connection to a new fints server that supports the DKB App for TANs instead of the old deprecated TAN app.
However, I cannot get it to work with the bootstrap example.
*Bank I tested this with
Name of the bank:
FinTS URL: https://fints.dkb.de/fints
Supported TAN mechanisms are supposed to be: DKB-App (decoupled), chipTAN manuell, chipTAN QR
Expected behavior
I'd expect the bootstrap example to work and ask for a TAN from the DKB App.
In the following code I would expect this to return a list of possible TAN mediums, however the list is empty:
importdatetimeimportgetpassimportloggingimportsysimportjsonfromdecimalimportDecimalfromfints.clientimportFinTS3PinTanClient, NeedTANResponse, FinTSUnsupportedOperationfromfints.hhd.flickerimportterminal_flicker_unixfromfints.utilsimportminimal_interactive_cli_bootstraplogging.basicConfig(level=logging.DEBUG)
config_file=open("config_dkb.json", "r")
config=json.load(config_file)
config_file.close()
bank_account=config.get("bank_accounts")[0]
product_id="xxxx"client_args= (
bank_account.get("blz"), # Your bank's BLZbank_account.get("login_name"), # Your login namebank_account.get("pin"), # Your banking PINbank_account.get("fints_url"),
)
tan_medium=bank_account.get("tan_medium")
f=FinTS3PinTanClient(*client_args, product_id=product_id)
f.fetch_tan_mechanisms()
mechanisms=list(f.get_tan_mechanisms().items())
print(mechanisms)
#f.selected_tan_medium = bank_account.get("tan_medium")minimal_interactive_cli_bootstrap(f)
defask_for_tan(response):
print("A TAN is required")
print(response.challenge)
ifgetattr(response, 'challenge_hhduc', None):
try:
terminal_flicker_unix(response.challenge_hhduc)
exceptKeyboardInterrupt:
passtan=input('Please enter TAN:')
returnf.send_tan(response, tan)
# Open the actual dialogwithf:
# Since PSD2, a TAN might be needed for dialog initialization. Let's check if there is one requirediff.init_tan_response:
ask_for_tan(f.init_tan_response)
# Fetch accountsaccounts=f.get_sepa_accounts()
ifisinstance(accounts, NeedTANResponse):
accounts=ask_for_tan(accounts)
iflen(accounts) ==1:
account=accounts[0]
else:
print("Multiple accounts available, choose one")
fori, mminenumerate(accounts):
print(i, mm.iban)
choice=input("Choice: ").strip()
account=accounts[int(choice)]
# Test pausing and resuming the dialogdialog_data=f.pause_dialog()
client_data=f.deconstruct(including_private=True)
f=FinTS3PinTanClient(*client_args, from_data=client_data, product_id=product_id)
withf.resume_dialog(dialog_data):
whileTrue:
operations= [
"End dialog",
"Fetch transactions of the last 30 days",
"Fetch transactions of the last 120 days",
"Fetch transactions XML of the last 30 days",
"Fetch transactions XML of the last 120 days",
"Fetch information",
"Fetch balance",
"Fetch holdings",
"Fetch scheduled debits",
"Fetch status protocol",
"Make a simple transfer"
]
print("Choose an operation")
fori, oinenumerate(operations):
print(i, o)
choice=int(input("Choice: ").strip())
try:
ifchoice==0:
breakelifchoice==1:
res=f.get_transactions(account, datetime.date.today() -datetime.timedelta(days=30),
datetime.date.today())
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
print("Found", len(res), "transactions")
elifchoice==2:
res=f.get_transactions(account, datetime.date.today() -datetime.timedelta(days=120),
datetime.date.today())
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
print("Found", len(res), "transactions")
elifchoice==3:
res=f.get_transactions_xml(account, datetime.date.today() -datetime.timedelta(days=30),
datetime.date.today())
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print("Found", len(res[0]) +len(res[1]), "XML documents")
elifchoice==4:
res=f.get_transactions_xml(account, datetime.date.today() -datetime.timedelta(days=120),
datetime.date.today())
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print("Found", len(res[0]) +len(res[1]), "XML documents")
elifchoice==5:
print(f.get_information())
elifchoice==6:
res=f.get_balance(account)
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
elifchoice==7:
res=f.get_holdings(account)
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
elifchoice==8:
res=f.get_scheduled_debits(account)
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
elifchoice==9:
res=f.get_status_protocol()
whileisinstance(res, NeedTANResponse):
res=ask_for_tan(res)
print(res)
elifchoice==10:
res=f.simple_sepa_transfer(
account=accounts[0],
iban=input('Target IBAN:'),
bic=input('Target BIC:'),
amount=Decimal(input('Amount:')),
recipient_name=input('Recipient name:'),
account_name=input('Your name:'),
reason=input('Reason:'),
endtoend_id='NOTPROVIDED',
)
ifisinstance(res, NeedTANResponse):
ask_for_tan(res)
exceptFinTSUnsupportedOperationase:
print("This operation is not supported by this bank:", e)
Log output / error message
It runs into
Exception has occurred: KeyError
'999'
File "/home/pete/Programming/fints/app/test_fints.py", line 32, in <module>
minimal_interactive_cli_bootstrap(f)
KeyError: '999'
However I get one step further: get_tan_mechanisms() correctly displays the decoupled TAN method (DKB App) as the only available method for me. When starting the client, DKB returns the challenge to confirm the login in the app. The app then sends a push message where I can confirm the login attempt. However, when I send an empty tan with f.send_tan(), the dialog is cancelled.
Describe the bug
DKB moved their connection to a new fints server that supports the DKB App for TANs instead of the old deprecated TAN app.
However, I cannot get it to work with the bootstrap example.
*Bank I tested this with
Name of the bank:
FinTS URL: https://fints.dkb.de/fints
Supported TAN mechanisms are supposed to be: DKB-App (decoupled), chipTAN manuell, chipTAN QR
Expected behavior
I'd expect the bootstrap example to work and ask for a TAN from the DKB App.
In the following code I would expect this to return a list of possible TAN mediums, however the list is empty:
Code required to reproduce
Log output / error message
It runs into
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: