jrhurley2 / TDInterface-Public

Windows Form application that uses TD Ameritrade Apis
3 stars 1 forks source link

Separate access tokens for TDA and TS #117

Closed jrhurley2 closed 1 year ago

jrhurley2 commented 1 year ago

Currently there is only one place to store access tokens "accesstoken.json", its either TDA or Tradestation tokens stored, . This causes 2 problems

1) No way to easily switch brokerage accounts, without relogging in. 2) When we upgrade to allow Equities trading through TD while simultaneously allowing futures trading through TS, we will need to have this in place.

Solution: Create a file per trading platform, TDA_AccessToken.json and TS_AccessToken.json.
AccessTokens will get stored in the Appropriate Helper class.
Helper classes will be responsible for refreshing tokens, and not rely on timer code in UI.