Guide to secure your SmartAPI Account with two factor authentication
-
@milind017 @aj_Brk why retry, it passed almost always on first time. Anyway. Not sure why parse_uri is needed.. also just pass totp as a string
-
TypeError: SmartConnect.generateSession() takes 3 positional arguments but 4 were given
-
@Ashok Actually you are right it works most of the time , but for those rare instances where by the time your request went and it expired on server side , i had added retry. It happened to me once perhaps due to slow code execution or internet.
-
@gokul try the latest library - pip install smartapi-python --upgrade . It appears the new version is live now
-
@mudit236 @babitakundu It appears it is updated now. Please try - pip install smartapi-python --upgrade
-
@Ashok Yes I have already tried with totp as string still its same
Yes retry not needed by still to be sure.
I have added both code to check if I am getting the same totp, which I am getting but still not able to get the success
Is pyotp is working for you? -
@milind017 @Ashok @gokul @Meenavenkit
Totp changes have been deployed in the latest python release 1.3.0
Please use the following command to upgrade to the latest python release
pip install smartapi-python --upgrade -
@aj_Brk Yes retrying working correctly, but I am not able to get the session token
Can you please share reference code -
@milind017 check value of angleOneURI, it should be like - otpauth://totp/<client id>?secret=<secrets>&issuer=angelone.in&algorithm=SHA1&digits=6&period=30
and there is no need for a while loop
-
@milind017 try as int(TOPT)
-
@SSumit Yes its exactly same except secret key and client id
-
@dakshesh yes tired same results
-
Please update the PHP API for TOTP and share the example for PHP Smart API Because, presently this not working with PHP Smart API
-
@msg2biswajit , please PM me , I will help
-
@milind017 PM me , we can resolve it
-
@milind017 PM me, I will try to help
-
@msg2biswajit : I have updated the PHP Smart API function as follows
public static function GenerateSession($clientcode, $password, $totp)and
$api_parameter = ['clientcode'=>$clientcode,'password'=>$password, 'totp'=>$totp];
now it's working. But, the problem is that I need to update that $totp value manually on every 30 Second, so how can I use that for continuously for whole day ? Please provide the solution
-
@admin
i am using tradetron and i am getting this errorAngelBroking get_access_token failed: AB1050 : Invalid totp
could you help me
-
does anybody using tradetron here...?
-
@admin what about C# SDK update ?