Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Invalid TOTP

    NodeJS SDK
    0
    4
    52
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Ankur Jain last edited by

      Hi, I m getting null user and invalid totp , below is complete error log.

      {"sourceID":"WEB","clientPublicIP":"49.43.99.128","macAddress":"0A-00-27-00-00-19","userType":"USER","clientLocalIP":"192.168.0.106","accept":"application/json"}***************************
      {"data":null,"message":"Invalid totp","errorcode":"AB1050","status":false}JSONObject["data"] is not a JSONObject (class org.json.JSONObject$Null : null).
      Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.angelbroking.smartapi.models.User.getAccessToken()" because "user" is null
      at MainClass.main(MainClass.java:22)
      Disconnected from the target VM, address: '127.0.0.1:54973', transport: 'socket'

      Pls help, i rechecked my totp and it is valid and there is no error.

      1 Reply Last reply Reply Quote 0
      • P
        pldbhalani last edited by

        You can add below code to get the correct TOTP

        GoogleAuthenticator gAuth = new GoogleAuthenticator();
        int totp = gAuth.getTotpPassword(secretKey);
        

        and below dependency from https://github.com/wstrange/GoogleAuth

        <dependency>
        	<groupId>com.warrenstrange</groupId>
        	<artifactId>googleauth</artifactId>
        	<version>1.4.0</version>
        </dependency>
        
        1 Reply Last reply Reply Quote 0
        • M
          Moderator_1 last edited by

          Hello @Ankur-Jain ,

          Apologies for delayed response and inconvenience is regretted.
          Can you provide your client code, 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

          1 Reply Last reply Reply Quote 0
          • L
            lastchancewell56 last edited by

            The error suggests a null user object and an invalid TOTP (Time-Based One-Time Password). Verify TOTP correctness and check the user object initialization in your code, as it seems to be null, leading to a NullPointerException. If TOTP is valid, focus on user object instantiation to resolve the issue

            1 Reply Last reply Reply Quote 0
            • First post
              Last post