AB1050 Invalid TOTP while connect.GenerateSession
-
@Vishal-naykawala said in AB1050 Invalid TOTP while connect.GenerateSession:
ur mail id.
-
@Vishal-naykawala How can I give you?
share your mail id.
-
@Vishal-naykawala said in AB1050 Invalid TOTP while connect.GenerateSession:
@PVRavindran I can provide you with the updated DLL. That change I made in DLL.
Please share..
-
@Vishal-naykawala Please provide me the latest one dll
-
@PVRavindran I can provide you with the updated DLL. That change I made in DLL.
-
@fcoder Thanks.
I have followed your code.. and now I am facing issue with http code: AB1006 - Client is block for trading.
-
I have revamped c# sdk version and have uploaded it to below link. This version works with totp. Here is the link :https://github.com/piyush-r-pub/SmartAPI_AO. How to use it: https://github.com/piyush-r-pub/SmartAPI_AO/wiki. Please let me know if you face any issues or need any help.
-
You are supposed to use any OTP library.
- Do you have the QR code for TOTP?
- Add OTPNet nuget in your project. (OTPNet)
- Convert TOTP QR to OTP string.
//Initialize Samart API using clientcode and password to test the code.
string totp = "2EYUVJNXYERUXPLAATDRTUHSWM";
string Client_code = "DELL2456"; //YOUR CLIENT CODE
string Password = "3456"; //YOUR PASSWORD
string api_key = "OvPZUMMM";
string JWTToken = ""; // optional
string RefreshToken = ""; // optionalSmartApi connect = new SmartApi(api_key, JWTToken, RefreshToken);
OutputBaseClass obj = new OutputBaseClass();//Login by client code and password
obj = connect.GenerateSession(Client_code, Password, totp);------Next in SmartConnetClass
/User Calls/
public OutputBaseClass GenerateSession(string clientcode, string password, string totpString)
{
OutputBaseClass res = new OutputBaseClass();
byte[] secretBytes = Base32Encoding.ToBytes(totpString);**// Create an instance of the TOTP class var totp = new Totp(secretBytes); // Get the current TOTP code string totpCode = totp.ComputeTotp();** res.status = true; res.http_code = "200"; try { AngelTokenResponse agr = new AngelTokenResponse(); string URL = APIURL + "/rest/auth/angelbroking/user/v1/loginByPassword"; string PostData = "{\"clientcode\":\"" + clientcode + "\",\"password\":\"" + password + "\",\"totp\":\"" + **totpCode** + "\"}";
If required, let me know, I can push entire code to GitHub
-
Hello @nitinshinde75 ,
Apologies for delayed response and inconvenience is regretted.
Can you provide your request and response and date and time when you faced this issue? Please share the above details to smartapi@angelbroking.com.
Thank you.Regards
SmartAPI Team -
I too have the same problem. Somewhere in the forum for another similar issue someone has responded to get updated Angel One DLLs ... the github libraries are all 2 years old. Where can I find the latest DLLs that support TOTP usage