Skip to content

App Login Broken #250

@ganzinotti

Description

@ganzinotti

Description of the bug
Today I tried to fetch data from trade republic and it seems the app login is broken.
The initiate_device_reset method is not working.
From the error message it seems something is outdated on the client side.

What I tried already

  • I already tried to update all the python libraries (certifi, websockets, requests etc.).
  • I randomly tried different User-Agent headers. Nothing worked.
  • I tried to reverse engineer the User-Agent headers using by my phone through a http proxy, but it seems trade republic blocks the CA certificate.

To Reproduce
Minimum code example:

import hashlib
from ecdsa import NIST256p, SigningKey
import requests

_default_headers = {"User-Agent": "TradeRepublic/Android 30/App Version 1.1.5534"}
_host = "https://api.traderepublic.com"

sk = SigningKey.generate(curve=NIST256p, hashfunc=hashlib.sha512)
r = requests.post(
    f"{_host}/api/v1/auth/account/reset/device",
    json={"phoneNumber": phone_number, "pin": pin},
    headers=_default_headers,
)
print(r.status_code)
print(r.json())

Expected behavior
This code should trigger a token to be send.

Error log

status code: 426
{'errors': [{'errorCode': 'CLIENT_VERSION_OUTDATED', 'errorMessage': None, 'meta': None}]}

Environment

  • OS: windows
  • package manager: conda
  • python: 3.13.9
  • pytr version: 0.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions