postback url is not working in kite connect api which creating access token

RevathiA
postback url is not working in kite connect api which creating access token , which was working till yesterday.

below is my code when i start execute this code
step 1) it will display the postback url which i've given in my developer console(http://127.0.0.1:5000/callback)
step 2) when I past that url http://127.0.0.1:5000 in web browser i used to be redirected to zerodha login and post successfull login i get the access token

in step2 when i paste the url(http://127.0.0.1:5000) in webbrowser it's loading not heading to zerodha login, which was working till yesterday

Please suggest some solution

kite = KiteConnect(api_key=API_KEY)
import os
print("Saving to:", os.getcwd())

@app.route("/")
def home():
login_url = kite.login_url()
return f"

Click to login to Zerodha:

{login_url}"

@app.route("/callback")
def callback():
print("Callback route hit")

request_token = request.args.get("request_token")
print("Request token received:", request_token)


if not request_token:
return "No request_token found in URL"

try:
data = kite.generate_session(request_token, api_secret=API_SECRET)
access_token = data["access_token"]
print("Access token:", access_token)
# Save token securely (for demo, writing to file)
with open("access_token.txt", "w") as f:
f.write(access_token)


return f"Access token generated and saved: {access_token}"
except Exception as e:
return f"Error: {str(e)}"

if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)

Sign In or Register to comment.