2 Replies Latest reply on Nov 9, 2018 5:22 AM by Michael Robinson

    Java REST APIs having trouble signing on if there is two step authentication

    Michael Robinson

      I'm trying to write a Java application to move Tableau files from a local file source to our test server.  I'm having some trouble which I think is tied to the fact that our tableau instance has two-factor authentication set up.  A co-worker that's trying python isn't having such trouble.  The code I use to invoke sign in is:


      TableauCredentialsType credentials = tableauAPI.invokeSignIn(username, password, destinationURL);


      According to the logs, the xml token that is generated is :

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

      <tsRequest xmlns="http://tableau.com/api">

         <credentials name="******" password="******">

            <site contentUrl="https://vis.test.itservices.msu.edu/"/>




      and what comes back is:


      <?xml version='1.0' encoding='UTF-8'?>

      <tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.1.xsd">

         <error code="401001">

            <summary>Signin Error</summary>

            <detail>Error signing in to Tableau Server</detail>




      I'm using the latest xsd (3.1) and the Java code comes from the git site.  Is there a different call I should be making to bypass the two-step authentication?