Looking for:
Google authenticator in zerodha - google authenticator in zerodhaGoogle authenticator in zerodha - google authenticator in zerodha
What's TOTP and How to generate It to Login into Zerodha Kite API using Python?
Google authenticator in zerodha - google authenticator in zerodha
As a temporary fix, Zerodha, an Indian financial services company, had blocked trading by default in all illiquid risky contracts, such as stocks and options. People were allowed to trade in them only on specific instructions from the customer through their registered email addresses.
Now, they have a permanent solution to this. They made it mandatory for all their users to use a mobile or email OTP to log in to Kite. This TOTP is valid only for a short duration, which is usually 30 seconds, and is regenerated every 30 seconds. Log In Register. Remember Me. Lost your password?
Home How to. This will generate a key like below. Please do not try and copy my key; I will have changed it by then :. Now, go ahead and scan this QR code using the Google Authenticator App, and once then, let's try and put this key into the code we wrote above. It Matches.
Unfortunately, Google Authenticator doesn't allow you to take screenshots of its app, so I had to take pictures from another phone. So, we now have a solution; we just need to integrate it in our regular Selenium Workflow, which I guess everyone uses to get requestToken.
Before all of this, please ensure you have all the required libraries to run the code; otherwise, it will not work correctly for you. You can use selenium as well if you prefer. Please note, the assumption is that you already have a Zerodha login script that you want to amend; if you are unsure how I constructed the above code, you will be better off looking at my Youtube Channel with a detailed video soon.
Please check the above code where I have mentioned the adjustment starting line and ending. The function should accept the TOTP Key as a parameter we got from Zerodha, and it will return a KiteObj, which you can use to place orders, fetch holdings, and all the regular stuff.
That's pretty much it, guys! Change is hard, and Zerodha has always been the pioneer in bringing change and making the trading experience secure and user-friendly. TOTP is undoubtedly moving in that direction, it indeed temporarily causes a little bit of inconvenience, but it's worth it, and look how easy it is to fix it anyway! I hope this article does help you.
I have uploaded this code on Github here. If you are still unsure how to fix your script, please fill in the Contact Us Form on the top with your details, and I will try and help you. Feel free to reach out to me on Linkedin or Twitter. If you have any suggestions about the blog, you can use the Feedback widget on the right hand of your screen, and if you wish to Contact Us, you can fill in the form here. If you like the content on Trade With Python, please do consider subscribing to our newsletter you will find an option at the top of the page.
Lastly, if you want to keep our spirits high and produce more content like this, you can BuyMeACoffee by clicking here or on the button below. Support Trade With Python by becoming a sponsor. Any amount is appreciated! What is TOTP? Why Zerodha is suddenly making it Mandatory?
No comments:
Post a Comment