Chavithra / degiro-connector

This is yet another library to access Degiro's API.
BSD 3-Clause "New" or "Revised" License
205 stars 46 forks source link

403 login error #116

Closed NoturBusiness closed 6 months ago

NoturBusiness commented 1 year ago

403 {"errors":[{"text":"Request is forbidden"}]}

IMPORTATIONS

import json import logging from degiro_connector.trading.api import API as TradingAPI from degiro_connector.trading.models.trading_pb2 import Credentials

credentials = Credentials( username='DeGiroRobot', password='NotMyPassword!#', one_time_password=333333, )

SETUP TRADING API

trading_api = TradingAPI(credentials=credentials)

CONNECT

trading_api.connect()

FETCH DATA

account_info_table = trading_api.get_account_info()

DISPLAY DATA

account_info_pretty = json.dumps(account_info_table, sort_keys=True, indent=4) print(account_info_pretty)

Chavithra commented 12 months ago

Hi there,

have you check if it's not an issue with the one_time_password ?

For instance by temporarly disabling 2FA.

Also to avoid having to manually set this field there is totp_secret_key parameter: see the documentation for information on this.

ferremek commented 6 months ago

I came across this issue and seem to have fixed it. When using the trading API you need to provide the int_account to the Credentials as well.

So it looks like this:

# SETUP CREDENTIALS
int_account = config_dict.get("int_account")
username = config_dict.get("username")
password = config_dict.get("password")

credentials = Credentials(
    int_account=int_account,
    username=username,
    password=password,
)

Click here how you can find your int_account.

Chavithra commented 6 months ago

Closing this issue.

Feel free to open a new issue if you have more information about it.

Thanks