Smart API Login issue
-
Hello @sunil_modi
Can you please use this pyotp library
totp = pyotp.TOTP(token).now()
https://pypi.org/project/pyotp/Regards,
SmartAPI Team -
@Moderator_3 This is what i am doing, still getting same error
secret_key = "f6f7faf4-7986-45-be2f-751f890b9be2"
base32_secret = base64.b32encode(secret_key.encode()).decode()
Generate a TOTP instance
totp = pyotp.TOTP(base32_secret).now()
-
@Moderator_3 i am doing the same still getting this error
secret_key = "f6f7faf4-7986-45-be2f-751f890b9be2"
base32_secret = base64.b32encode(secret_key.encode()).decode()
totp = pyotp.TOTP(base32_secret)
obj = SmartConnect(api_key=api_key)
data = obj.generateSession(client_id, '5437', totp.now())
-
Home @sunil_modi
Can you please don't encode the string which you are getting from the totp screen.Instead of encoding please pass it directly
Regards,
SmartAPI Team -
@Moderator_3 if i directly pass the secret key it is giving error like
-
Hi,
Can you please solve this issue.{"status":false,"message":"Invalid totp","errorcode":"AB1050","data":null}
-
@Moderator_3 i got this error when i don't encode
when i simply pass secret key i got this error
would you please give me connection code
-
Hello @sunil_modi
I can see still you are passing the encoded secret_key while calling the pyotp.please check and confirm the same
Regards,
SmartAPI Team -
@Moderator_3 i am not able to login to totp screen. Everytime i try to login using mpin i am getting this error
-
@sunil_modi are you passing your mobile MPIN in the password field? Please pass that here. We are working to change this nomenclature here.
Also, the secret key for TOTP is not the secret key generated along with the API key in the app. The string which you need to pass in the TOTP is the one generated below the QR code in TOTP Generation.