bnw / firefly-iii-fints-importer

Import financial transactions from you FinTS enabled bank into Firefly III.
GNU Affero General Public License v3.0
151 stars 23 forks source link

Unable to get transactions from DKB #130

Open se7entynine opened 7 months ago

se7entynine commented 7 months ago

Hey,

I am unable to get information from my bank ( DKB ). With 910, 911, 912 or 913, but every method fails with a similar error message as this one:

910,911,912,913: Fatal error: Uncaught Fhp\Protocol\ServerException: FinTS errors: 9050 (global): Die Nachricht enthält Fehler. 9800 (global): Dialog abgebrochen 9900 (wrt seg 4): Anmeldung fehlgeschlagen. (MBV07390100153) FinTS warnings: 3905 (global): Es wurde keine Challenge erzeugt. 3920 (wrt seg 4): Zugelassene Zwei-Schritt-Verfahren für den Benutzer. [910, 911, 912, 913] Request segments: HKVVB:4:3+12+0+0+0F4CA8A225AC9799E6BE3F334+1.0' in /vendor/nemiah/php-fints/lib/Fhp/Protocol/ServerException.php:170 Stack trace: #0 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(963): Fhp\Protocol\ServerException::detectAndThrowErrors(Object(Fhp\Protocol\Message), Object(Fhp\Protocol\Message)) #1 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(307): Fhp\FinTs->sendMessage(Object(Fhp\Protocol\Message)) #2 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(263): Fhp\FinTs->execute(Object(Fhp\Protocol\DialogInitialization)) #3 /app/Login.php(23): Fhp\FinTs->login() #4 /app/TanHandler.php(41): App\StepFunction\{closure}() #5 /app/TanHandler.php(31): App\TanHandler->create_or_continue_action() #6 /app/Login.php(21): App\TanHandler->__construct(Object(Closure), 'login-action', Object(Symfony\Component\HttpFoundation\Session\Session), Object(Twig\Environment), Object(Fhp\FinTs), Object(App\Step), Object(Symfony\Component\HttpFoundation\Request)) #7 /app/index.php(59): App\StepFunction\Login() #8 {main} thrown in /vendor/nemiah/php-fints/lib/Fhp/Protocol/ServerException.php on line 170

The process in my bank is with either username the same: username/password + app confirmation or chiptan. Firefly and the rest runs on docker.

version: '3.3'

services:
  app:
    image: fireflyiii/core:latest
    hostname: app
    container_name: firefly_iii_core
    restart: always
    volumes:
      - ${PWD}/firefly_iii_upload:/var/www/html/storage/upload
    env_file: .env
    networks:
      - firefly_iii
    ports:
      - 7777:8080
    depends_on:
      - db
  db:
    image: mariadb:lts
    hostname: db
    container_name: firefly_iii_db
    restart: always
    env_file: .db.env
    networks:
      - firefly_iii
    volumes:
      - ${PWD}/firefly_iii_db:/var/lib/mysql
  cron:
    #
    # To make this work, set STATIC_CRON_TOKEN in your .env file or as an environment variable and replace REPLACEME below
    # The STATIC_CRON_TOKEN must be *exactly* 32 characters long
    #
    image: alpine
    restart: always
    container_name: firefly_iii_cron
    command: sh -c "echo \"0 3 * * * wget -qO- http://app:8080/api/v1/cron/${STATIC_CRON_TOKEN}\" | crontab - && crond -f -L /dev/stdout"
    networks:
      - firefly_iii

  importer:
    image: fireflyiii/data-importer:latest
    hostname: importer
    restart: always
    container_name: firefly_iii_importer
    networks:
      - firefly_iii
    ports:
      - '7776:8080'
    depends_on:
      - app
    env_file: .importer.env

  fints-importer:
    image: benkl/firefly-iii-fints-importer
    volumes:
        - ${PWD}/fints-importer/data/configurations:/app/configurations
    ports: 
        - 7778:8080
    networks:
      - firefly_iii

networks:
  firefly_iii:
    driver: bridge

Personal access token is used and I also tried different urls like: http://app:7777, http://192.168.10.104:7777 or http://app:8080 like the importer. Double checked BLZ and fints-url. The normal bank page login works so it's not a problem on their side.

These are the informations from my bank about fints:

Bankleitzahl: 120 300 00 Sicherheitsmedium: HBCI-PIN mit chipTAN/TAN2go Benutzerkennung: Dein Anmeldename Kunden-ID: Dieses Feld bitte frei lassen HBCI-Version: FinTS 3.0 Kommunikationsadresse: https://banking-dkb.s-fints-pt-dkb.de/fints30

Any idea what is wrong in my setup or is it a bug?

se7entynine commented 3 months ago

Still an error message with 2FA 921: PushTAN is registered with my bank.

Fatal error: Uncaught Fhp\Protocol\ServerException: FinTS errors: 9050 (global): Die Nachricht enthält Fehler. 9800 (global): Dialog abgebrochen 9900 (wrt seg 4): Anmeldung fehlgeschlagen. (MBV07390100153) FinTS warnings: 3905 (global): Es wurde keine Challenge erzeugt. 3920 (wrt seg 4): Zugelassene Zwei-Schritt-Verfahren für den Benutzer. [921] 3961 (wrt seg 4): Freischaltung einer pushTAN-Verbindung erforderlich. (MBV07390100249) [pushtan] Request segments: HKVVB:4:3+13+0+0+0F4CA8A225AC9799E6BE3F334+1.0' in /vendor/nemiah/php-fints/lib/Fhp/Protocol/ServerException.php:170 Stack trace: #0 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(963): Fhp\Protocol\ServerException::detectAndThrowErrors(Object(Fhp\Protocol\Message), Object(Fhp\Protocol\Message)) #1 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(307): Fhp\FinTs->sendMessage(Object(Fhp\Protocol\Message)) #2 /vendor/nemiah/php-fints/lib/Fhp/FinTs.php(263): Fhp\FinTs->execute(Object(Fhp\Protocol\DialogInitialization)) #3 /app/Login.php(23): Fhp\FinTs->login() #4 /app/TanHandler.php(41): App\StepFunction\{closure}() #5 /app/TanHandler.php(31): App\TanHandler->create_or_continue_action() #6 /app/Login.php(21): App\TanHandler->__construct(Object(Closure), 'login-action', Object(Symfony\Component\HttpFoundation\Session\Session), Object(Twig\Environment), Object(Fhp\FinTs), Object(App\Step), Object(Symfony\Component\HttpFoundation\Request)) #7 /app/index.php(59): App\StepFunction\Login() #8 {main} thrown in /vendor/nemiah/php-fints/lib/Fhp/Protocol/ServerException.php on line 170

kolaente commented 2 months ago

I get the same error, with a configuration that worked previously.

Oddly enough, the fints importer does not even ask for a tan, that would kind of explain why the fints api complains about not having recieved a tan.

When I try with any 2fa mode other than 910, 911, 912 or 913 I get an error message like this:

 Fatal error: Uncaught AssertionError: Your bank did not accept your tan mode 921. Accepted modes are: 910, 911, 912, 913 in /app/FinTsFactory.php:58 Stack trace: #0 /app/FinTsFactory.php(58): assert(false, 'Your bank did n...') #1 /app/FinTsFactory.php(30): App\FinTsFactory::get_tan_mode(Object(Fhp\FinTs), Object(Symfony\Component\HttpFoundation\Session\Session)) #2 /app/CollectData.php(61): App\FinTsFactory::create_from_session(Object(Symfony\Component\HttpFoundation\Session\Session)) #3 /app/index.php(51): App\StepFunction\CollectData() #4 {main} thrown in /app/FinTsFactory.php on line 58

This article seems to suggest the problem is the tan method.

The DKB claims in their FAQ that there will be changes "this fall" to the tan method, I wonder if this is maybe related to this?

bnw commented 2 months ago

Are you using the GUI? Entering TANs in the non-GUI mode is not supported.

ruegr commented 1 month ago

Same over here. For my account just tan mode 921 seems to be accepted. After the initial bank account form I receive the page "Choose a device for your tan method." and can select from two (known) tan-devices. But there ist just a button "Collect statements from your bank" without an input for the actual tan. When I press the button the following error-message appears: Fatal error: Uncaught AssertionError: Missing value in sessions for: bank_url in /app/FinTsFactory.php:19 Stack trace: #0 /app/FinTsFactory.php(19): assert(false, 'Missing value i...') #1 /app/Login.php(17): App\FinTsFactory::create_from_session(Object(Symfony\Component\HttpFoundation\Session\Session)) #2 /app/index.php(61): App\StepFunction\Login() #3 {main} thrown in /app/FinTsFactory.php on line 19

bnw commented 1 month ago

@ruegr This seems to be an unrelated issue, because the error message is different. Please try to restart the whole procedure and make sure not to use the back & forth buttons of your browser, because this can corrupt your session. Please open another ticket if the error persists.

ruegr commented 1 month ago

@ruegr This seems to be an unrelated issue, because the error message is different. Please try to restart the whole procedure and make sure not to use the back & forth buttons of your browser, because this can corrupt your session. Please open another ticket if the error persists.

Sorry, my mistake. I filed a new issue: https://github.com/bnw/firefly-iii-fints-importer/issues/141#issue-2481317328

mackshot commented 2 weeks ago

Are you using the GUI? Entering TANs in the non-GUI mode is not supported.

I can confirm that issue using DKB using your GUI. Not sure if it helps, but I switched my smartphone and thus my 2fa lately. Using DKB website and app the new 2fa device works. But during the import process the GUI shows me only my old device in the dropdown.

bnw commented 2 weeks ago

@mackshot Maybe you need to choose a different TAN method?

mackshot commented 2 weeks ago

@bnw Thank you for your quick reply.

Let me summarize the current state: I have two logins to DKB online banking. 1) Login with Account-Number & PasswordA and 2) Login with Account-Number with suffix "_p" & PasswordB. Account-Number with suffix "_p" was introduced by DKB when they established their Push-TAN method.

If I try to login with 1) the importer forwards the reply that I have to use Tan-Method 910, 911, 912 or 913, see https://github.com/bnw/firefly-iii-fints-importer/issues/130#issue-2173356368. But they does not work ;)

If I try to login with 2) and Tan-Method 921 (this worked before!) the problem as mentioned here https://github.com/bnw/firefly-iii-fints-importer/issues/130#issuecomment-2198322185 appears. As mentioned before ... during this process I have to select the 2fa device. In the dropdown only an OLD, no longer registered as 2fa with DKB, is listed. My new device is not listed there.

I hope this helps.