jessecooper / pyetrade

Python E-Trade API Wrapper
GNU General Public License v3.0
207 stars 98 forks source link

oauth issue #56

Closed alanoatwork closed 2 years ago

alanoatwork commented 2 years ago

If I understand correctly, shouldn't renew_access_token(), if called every day, continue to allow access? After several weeks of operation I just received error 401 after calling renew_access_token() and had to call get_access_token() and go through the entire login process. Is there a programmatic way to avoid having to call get_access_token()?

mw66 commented 2 years ago

you can use selenium webdriver to automate login:

https://github.com/charley-padron/Trading-System/blob/master/automatedTrading.py

alanoatwork commented 2 years ago

I'm running a headless Synology box, and running Selenium isn't supported. Is these not a method to continually renew access tokens with Etrade via this package? As far as I can tell, Ally or TDAmeritrade doesn't have this requirement to manually authenticate.

mw66 commented 2 years ago

Selenium can run headless, if you willing to write your login password somewhere, and a bit Selenium coding.

Last time I checked with Etrade, they said they are not offering such a requirement. You can call them to request again, if more people request this feature, maybe they will change their mind, esp, if you have a big account.

chrsunwil commented 2 years ago

Hi, I'm trying to use Selenium to login, but after I login, I briefly get the agreement page, until I get "Due to a logon delay or other issue, your authentication could not be completed at this time. Please try again. " at the top of the page. I wasn't able to find any info anywhere else. Do you have any experience with this?

mw66 commented 2 years ago

https://stackoverflow.com/questions/57752683/problem-logging-onto-e-trade-on-selenium-and-chrome-driver

You need ask etrade to give you ETWLCUST1 value, see the link above.

chrsunwil commented 2 years ago

Thanks! I don't think that actually was the issue I had been getting, but now that I've switched to using a chrome driver, I'm getting that exact error message. I'm probably not hiding the Selenium usage adequately enough.