Expand description
OAuth2 Authorization Code flow with token refresh for TradeStation API.
TradeStation uses OAuth2 with:
- Authorization endpoint:
https://signin.tradestation.com/authorize - Token endpoint:
https://signin.tradestation.com/oauth/token - Access token lifetime: 20 minutes
- Refresh token lifetime: ~30 days
§Flow
- Build an authorization URL with
Credentials::authorization_url. - User visits the URL and grants access.
- Exchange the callback code via
exchange_code. - The
Tokenauto-refreshes throughClient::access_token.
Structs§
- Credentials
- OAuth2 client credentials for the TradeStation API.
- Token
- OAuth2 token with expiration tracking.
Enums§
- Scope
- OAuth2 scopes controlling API access levels.
Functions§
- exchange_
code - Exchange an authorization code for an access/refresh token pair.
- refresh_
token - Refresh an expired access token using the refresh token.
- revoke_
token - Revoke a refresh token, invalidating it for future use.