c# TOTP Loging Error New DLL with updated Generate Session method


    1. Download angelone solution file from sdk.

    2. Edit below code . I have added totp part for post request.

    3. Build solution & use generated DLL from this.
      47ac9ec9-39cf-4159-a0ef-b0eaa2d4abe6-image.png

    4. Since Generate session method is updated now, we can pass TOTP parameter.

    5. To generate TOPT ,

    • Install Otp.Net package from Nuget packages.
      407e478f-078f-4a25-8b4b-c60f3308b1a8-image.png

    • Once it is installed, use below function to generate TOTP

      Public Shared Function GetTotp() As String
      Dim secretKey = OtpNet.Base32Encoding.ToBytes("JSPCTWENRTFATEQXFE227P7ADI")
      Dim totp = New Totp(secretKey)
      Dim otp = totp.ComputeTotp()
      Return otp
      End Function

    • Aboce code is in vb.net. If required convert it to c# using online converters.

    • Use above function to generate TOTP.
      e.g.
      Dim totp as string
      totp = GetTotp()

    Use above lines of code before calling Generatesession method.

    • Finally , it will pass post data to url & you will be able to login successfully.