samjtro / schwab

⚡ fast unofficial schwab traderapi hook
https://pkg.go.dev/github.com/samjtro/schwab
GNU General Public License v2.0
3 stars 0 forks source link

headless browser for oAuth Leg 1? #24

Closed samjtro closed 1 month ago

samjtro commented 1 month ago
          This was an error that was stemming from the import path as I attempted to test it in another repo.

When I migrated this project from 'go-tda' -> 'go-trade', I accidentally left the original go.mod in after I changed the Github URL.

I believe this has somehow messed up go.mod/.sum.

Need to regenerate go.mod.

Originally posted by @samjtro in https://github.com/samjtro/go-trade/issues/23#issuecomment-2129583634

samjtro commented 1 month ago

Generated a new go.mod/.sum: 6481c0806304d844dda49bb693cc92ef17ee4862

samjtro commented 1 month ago

I added functionality I believed to open the browser @ the provided SchwabAPI url for brokerage account login to complete the CAG process of the oAuth flow, then have the user paste the URL into the application. For some reason, it is not doing this, and instead returning the same error 401 that I was receiving previously.

Going to do some fingerprinting and attempt to find the cause - it might also be the case that my browser implementation just doesn't work. If that is the case, I am going to look into a headless implementation now. I just realized that I actually have implemented a headless browser in golang before - in the repo sn.

Need to figure out authentication headless.

samjtro commented 1 month ago

This error was being caused because of a previous version of db.txt that was throwing off the os.Stat function in Handler(). Turning this issue into a repo for my thoughts on headless authentication v browser auth for Leg 1 of oAuth.

samjtro commented 1 month ago

Might do this later