Shoonya-Dev / ShoonyaApi-py

144 stars 134 forks source link

Unable to Login #57

Closed priyasdipu closed 1 year ago

priyasdipu commented 2 years ago

Hello,

Unable to login since 01-Oct morning. It was working fine till 30-Sep. I was passing my pancard in factor2 as paramenter

Today the error message is "emsg":"Invalid Input : Invalid OTP"}"

Where to generate the OTP & pass it here?

I tried to generate OTP while app login and passed the same as factor2. That worked only for once. If I run the script again, its showing same error message.

Anyone else facing same issue?

TheCodeArtist commented 2 years ago

Unable to login since 01-Oct morning. It was working fine till 30-Sep. I was passing my pancard in factor2 as paramenter

Per recent regulations, this was the cut-off date to brokers to activate OTP/TOTP for all such logins.

I tried to generate OTP while app login and passed the same as factor2. That worked only for onc

As the name suggests, OTP is a One Time Password. Once you have registered an app with Shoonya to generate the OTP as shown in Two Factor authentication doc.pdf, you can provide a new OTP for each login attempt using the API.

priyasdipu commented 2 years ago

Hi,

I got that. But since I'm building & testing the code for a new strategy. I might have to tweak things multiple times and run. Do I have to provide OTP for each run?

Is there any workaround for this?

yogesh0800 commented 2 years ago

Same issue i am also getting.

yogesh0800 commented 2 years ago

Got the solution try below. use Your TTOP QR code here.

pip install pyotp import pyotp

factor2 = pyotp.TOTP('T26#6#466#############').now()

priyasdipu commented 2 years ago

@yogesh0800 You saved my day. Thanks a lot.

priyasdipu commented 2 years ago

Hi,

I'm facing another type of issue now. I have used the sleep function for 60 secs if some of the conditions doesn't match.

It initiates fine but then it is unable to fetch the token (or any data) after the sleep.

Any help?

DeepBhuptani commented 2 years ago

create a login function and put it after your sleep function, it will login again after sleeping for 60sec 😄