Open algowhizz opened 3 years ago
@algowhizz Where can i get user_session_token ? Can you guide me on that.
@algowhizz Where can i get user_session_token ? Can you guide me on that. https://github.com/algowhizz/kotakapi/blob/23c37c480d0422dbf2e185caa57132b02a84fa6f/2fa_ott_login.py This is the code you need to use to generate the session token given by https://github.com/algowhizz/kotakapi/blob/23c37c480d0422dbf2e185caa57132b02a84fa6f/2fa_ott_login.py#L36
@algowhizz Thanks for providing the info. This is really helpful.
One last question on this..
Is my understanding correct.
- My understanding based on the code that you shared is OTT will remain constant till we change any one of parameter like the password, consumer key, access token. So if that is changed we need to regenerate OTT.
OTT needs to be generated everyday as it basically replaces the OTP that you receive via e-mail or SMS. Since it is easier to generate OTT than fetch OTP using selenium, I have written the script for automated OTT and session token generation every day.
- Session Token part of the python code is something i can integrate in my regular python code that will generate a new session token for every session.
Since OTT has to be generated everyday, the session token follows the OTT. So, the procedure is as simple as : generate OTT followed by session token (valid for 1 day). Then use the session token in your further code. If you dont wish to do all this, you can simply use the standard method where OTP is used to initialise ks_client.
@algowhizz Thanks for answering the questions. This method is easier. I will take this.
@algowhizz One more question... In the previous method where I manually give access code(OTP) and login, if I try to login again in a different system, it will automatically kill my session in previous system. But now with this method, it is not killing my previous system. How to kill a kotak session connectivity in linux.
Hi, I have added a function which allows the user to pass session_token generated via curl or requests using various session_API login methods like OTT. Once session_token is generated, it can be set using
client.set_session_token
as :followed by usual client operations. I believe this is a good functionality to add because it allows user to initiate client without OTP access_code.