error AB1050
-
Getting totp error for one of my client .
[I 240608 11:04:15 smartConnect:121] in pool [E 240608 11:04:15 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Invalid totp. URL: https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '64:00:6a:07:e2:96', 'Accept': 'application/json', 'X-PrivateKey': 'VhEczsBX', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'clientcode': 'xxxxxxx', 'password': 'xxxx', 'totp': 'xxxxxx'}, Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None}
-
Hi @anodkar @sunil_modi Apologies for delayed response. The TOTP value should be a six-digit number configured in the Authenticator app. TOTP number should generate newly every 1 minute check that too. If the issue persists, please let us know with the required details.
Regards,
SmartAPI Team. -
@sunil_modi Response: {'status': False, 'message': 'Invalid totp', 'errorcode': 'AB1050', 'data': None} I too getting same error. Everything on place then what is wrong
-
@Moderator_3
I am using same library and getting same error. -
I tried having separate value of pyotp.TOTP(TOEKN).now() but still same issue. please refer attached screenshot.
How does it solve problem if I assign it in separate variable?
-
Hello @pas22021990
Please assign the value of totp into a separate variable instead of calling it out directly
Then use the variable inside itRegrads,
SmartAPI Team -
@Moderator_3
Hi I am using pyotp python library but still getting same error.obj=SmartConnect(api_key=API_KEY,debug=True)
data = obj.generateSession(USER_NAME,PWD,pyotp.TOTP(TOEKN).now())Response:
{'status': False,
'message': 'Invalid totp',
'errorcode': 'AB1050',
'data': None} -
Hello @Mnagesh
Can you please use the pyotp python library
totp = pyotp.TOTP(token).now()
https://pypi.org/project/pyotp/Regards,
SmartAPI Team -
How did solve this error? As i am not able to enable TOTP and when i try to generate it using secret i got the same error as yours.