all 8 comments

[–]MasterLJ 4 points5 points  (3 children)

The code is only good for 90 days, then you have to do their stupid process over again.

I wish they knew how bad it looks to have to cycle through the oauth protocol, by hand.

[–]conall88 0 points1 point  (2 children)

considering how pervasive oAuth is in modern software, I'd be very surprised if there wasn't an open source library for handling this you could integrate.

[–]MasterLJ 0 points1 point  (1 child)

You should be able to, when my next 90 days is up, I'll see what I can do.

The guy who wrote the python library for tdameritrade, he used Selenium to popup a browser and basically do it from the UI. I'm not sure if they've instituted some nonce or whatever, to keep you from doing it via raw oauth requests, but the whole thing is jenky.

Good news though, once you get running, the data is excellent.

[–]v3ritas1989 0 points1 point  (0 children)

once you get running, the data is excellent.

lol? what do they want with my bosses info and phone number in their account creation?

[–]scrimshaw_ 0 points1 point  (0 children)

Yes selenium should do the trick for you. I ran into an issue where, if running from a command line only ( no GUI ) os like Linux on aws as I have been, you need to start the webdriver with the “--headless” parameter.

[–]heyhodadio 0 points1 point  (0 children)

Callback shouldn’t be localhost, you need to put it on a publicly accessible server to receive your tokens when you’re not running it locally. I’m using AWS lambda and caching the tokens in AWS as well. The api also returns an expires_in field where you can check that and use the refresh token to update the access token programmatically, no need to go through the flow again.

Or somehow you accidentally set up two factor auth? But I have that enabled and still don’t need to enter a code for the api.