Getting bad access token in kite connect

UF0940
UF0940 edited July 9 in Python client
Hi,
I am getting the same access token every time for a month and it doesn't work.
I am able to successfully use kite using only request_token every time, however, access_token is not working.
Here's my code after importing all libraries:

api_key = "xxx"
api_secret='xxx';
kite = KiteConnect(api_key=api_key)
print("Login here:", kite.login_url() )
request_token="xxx"
gen_ssn = kite.generate_session(request_token, api_secret)
acc_tkn=gen_ssn['access_token']
print(acc_tkn)

It works fine with using only request_token. However, that way I cannot stream on websocket.
For websocket streaming I need access token to be generated.
Here's how my current access token looks like (modified a bit):
KXdCGLJRQeFYdfjJfwVD0u3dpL3gWXZq
Regards

Also, I am subscribed only to kite api but not for historical data.
Do we need kite Historical api subscription for access to websocket streaming?
  • rakeshr
    Are you following the steps mentioned here for access token generation?
    You can refer access token generation steps here for python client. This thread gives more detail on the above issue.
    Do we need kite Historical api subscription for access to websocket streaming?
    No.
  • UF0940
    @rakeshr Hi. I followed all the steps in my terminal instead of the python client. I still get the same access_token that I mentioned above and that I have been getting for a month without change in my terminal.
  • UF0940
    UF0940 edited July 9
    Hi @rakeshr my issue is solved. I had to restart everything and it worked then.
    I was expecting that the access token will change when I generate it again, or when I change the api secret but that did not happen. Thanks.
This discussion has been closed.