Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tradestation has changed authentication from auth2 to auth0 Guardian #13

Open
sathiyaparmar opened this issue Dec 1, 2021 · 3 comments

Comments

@sathiyaparmar
Copy link

Tradestation has changed authentication from auth2 to auth0 Guardian. This library still uses auth2, Can you please update the authentication

@syntaxsdev
Copy link

Have you worked around this issue yet?

@jasmarc
Copy link

jasmarc commented Mar 8, 2022

@Gabedave how is your fork coming along? Does it work?

@sfyll
Copy link

sfyll commented Dec 14, 2022

As stated, this code has to be refactored so that authentication works with auth0, new links and guidelines can be found in the docs: https://api.tradestation.com/docs/fundamentals/authentication/auth-code/
A couple of additional comments once you got auth0 working:

  • once you've authenticated, make sure that you change your calls endpoints + args respecting new api version (v3). can be seen on the above docs + specs
  • add offline_access in scope so that you can have access to refresh_token and make the process algorithmic without having to login on each iteration. PLEASE NOTE THAT YOUR CONFIG FILE SHOULD BE ENCRYPTED/DECRYPTED on the fly, which isn't done here and is a security concern.
  • if you've done the above, simply login within the init function and the code will take care of understanding if it has to go through the lengthy authentication process or it has a refresh token to grab.
  • modify line 567: if response_headers['Content-Type'] == 'application/json; charset=utf-8' to ['application/json', 'charset=utf-8']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants