Navigation

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

    Facing issue in TOTP Automation

    NodeJS SDK
    0
    8
    135
    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
      AravindAnbalagan last edited by

      Hello Folks

      I trying to get the TOTP through java but was unable to make it work.

      Below is the code snippet, I request to help on this.

      String key = "";
      String clientID = "";
      String clientPass = ""
      String apiKey = ""

      	String totp = getTOTPCode(apiKey);
      	
      	
      	GoogleAuthenticator gAuth = new GoogleAuthenticator();
      	String code = String.valueOf( gAuth.getTotpPassword(totp));
      
      	
      	SmartConnect smartConnect = new SmartConnect(apiKey);
      	
      	smartConnect = new SmartConnect(apiKey);
      	User user = smartConnect.generateSession(clientID, clientPass, code); // getting "message":"Invalid totp","errorcode":"AB1050"
      	String feedToken = user.getFeedToken();
      	System.out.println("feedToken " +feedToken);
      	smartConnect.setAccessToken(user.getAccessToken());
      	smartConnect.setUserId(user.getUserId());
      
      V 1 Reply Last reply Reply Quote 0
      • A
        AravindAnbalagan last edited by

        Issue got resolved by passing key in the getTOTPCode(key).

        R S 2 Replies Last reply Reply Quote 0
        • R
          Rishab @AravindAnbalagan last edited by

          @AravindAnbalagan
          hi can you please share the code how to get atomation totp
          mail id : rishab20dec2015@gmail.com

          A 1 Reply Last reply Reply Quote 1
          • A
            AravindAnbalagan @Rishab last edited by

            @Rishab Sure

            1 Reply Last reply Reply Quote 1
            • V
              vikasjoshi.00 @AravindAnbalagan last edited by

              @AravindAnbalagan Hi it is resolved, I am facing same issue. If yes can you share your code

              1 Reply Last reply Reply Quote 1
              • S
                SpandanMn @AravindAnbalagan last edited by

                @AravindAnbalagan said in Facing issue in TOTP Automation:

                Issue got resolved by passing key in the getTOTPCode(key).

                the key is api key or what

                1 Reply Last reply Reply Quote 0
                • D
                  dipeshbodas last edited by

                  getTOTPCode(apiKey);

                  can you share the code for this ?
                  facing issues while using totp
                  dipesh.bodas@gmail.com

                  A 1 Reply Last reply Reply Quote 0
                  • A
                    AravindAnbalagan @dipeshbodas last edited by

                    @dipeshbodas

                    public static String key = "Agf5EKgf2EGRTGRGgf7DOKSJI6gfSZG66Q";
                    public static String clientID = "XXXXX";

                    public static String clientPass = "0000";
                    public static String apiKey = "ggklv44L";

                    GoogleAuthenticator gAuth = new GoogleAuthenticator();
                    String code = String.valueOf( gAuth.getTotpPassword(key));

                    smartConnect = new SmartConnect(apiKey);
                    user = Optional.ofNullable(smartConnect.generateSession(clientID, clientPass, code));

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