schwab-py icon indicating copy to clipboard operation
schwab-py copied to clipboard

Access token not refreshing

Open bman393 opened this issue 9 months ago • 3 comments

Description of Bug I created my token with client_from_manual_flow, all my inputs are correct. It then only gives me a expires_in token of 1800 (30 min). Then I use schwab.auth.client_from_token_file to create my client which is also suppose to refresh my token as well right? But my token still expires on the first set 30 min My token file exists on the same level as the code I am using to grab quotes. Here is my code: `from schwab.auth import client_from_manual_flow api_key='', app_secret='', callback_url='https://127.0.0.1/', token_path='/mnt/c/Users/Brogan/Documents/tickerStats/schwab-py/token.json' def getPrice(ticker): client = schwab.auth.client_from_token_file(token_path, api_key, app_secret)

r = client.get_quote(ticker)

r=r.json() print(r) getPrice('$SPX')` Expected Behavior I expect the access token to update to a new expire time. Actual Behavior Instead, the token still expires at my original set time from the manual token creation. I have to manually create the token every 30 min to access schwab Error/Exception Log, If Applicable

bman393 avatar May 22 '24 17:05 bman393