Token is Invalid or has Expired

Aditya_singhania
While generating session this error is coming. Can someone please help me.
I have checked other threads with same issue but could not find proper solution.

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:https://api.kite.trade:443 "POST /session/token HTTP/1.1" 403 None
Traceback (most recent call last):
File "C:\Users\welcome\Desktop\algo.py", line 44, in
get_login(ak,asec)
File "C:\Users\welcome\Desktop\algo.py", line 31, in get_login
data = kite.generate_session(request_tkn,api_secret=asec)
File "C:\Users\welcome\AppData\Local\Programs\Python\Python39\lib\site-packages\kiteconnect\connect.py", line 257, in generate_session
resp = self._post("api.token", params={
File "C:\Users\welcome\AppData\Local\Programs\Python\Python39\lib\site-packages\kiteconnect\connect.py", line 840, in _post
return self._request(route, "POST", url_args=url_args, params=params, is_json=is_json, query_params=query_params)
File "C:\Users\welcome\AppData\Local\Programs\Python\Python39\lib\site-packages\kiteconnect\connect.py", line 912, in _request
raise exp(data["message"], code=r.status_code)
kiteconnect.exceptions.TokenException: Token is invalid or has expired.
Sign In or Register to comment.