3 Replies Latest reply on Nov 12, 2015 11:10 PM by Toni Juvani

    Publishing a data source with embedded password fails through tabcmd's "clientxml" api

    Toni Juvani

      Hi,

       

      We are using Tableau HTTP interface to automatically copy data sources and workbooks from site to another. The whole system was implemented using the REST API but since we had performance and stability issues we re-implemented it using the undocumented "clientxml" API that that tabcmd also uses. This API also supports a feature we need: refreshing an extract.

       

      The whole thing seems to work otherwise very fine but I am unable to publish a data source with an embedded password. I've implemented the tool using C# and took example from this ruby implementation https://github.com/tjgrathwell/tableau.

       

      See below for an example error response when posting to url http://tableau/t/UnitTest/vizportal/api/clientxml/create/datasources

       

      I have noticed that the length of "full_keychain" parameter in my implementation is a lot shorter than the one in the request the actual tabcmd sends. This suggests that maybe the encryption algorithm has changed and is not 3DES anymore like in the example ruby implementation. See: https://github.com/tjgrathwell/tableau/blob/master/tabcmd/lib/commands/publish.rb

       

      Would it be possible to get pointers on how to correctly encrypt the username and password so that I can embed it in the data source when publishing?

       

      Br,

      Toni Juvani

       

      Request

       

      POST http://tableau/t/UnitTest/vizportal/api/clientxml/create/datasources?language=en&authenticity_token=RnLa3dvuUT3zYIwthVRNfdLoiNvqQqaB&tds_upload_id=20821%3A453629F7362744FF8E6D56E858DBC22F-0%3A1 HTTP/1.1

      Host: tableau-dev.utilytics.local

      Cookie: workgroup_session_id=tb2e7SeUU1tY6xtKO5fvdrpHLxSGSER3

      User-Agent: Tabcmd/9.0, Build 9000.15.0618.1800; OS Windows 8, version 6.2

      Content-Type: multipart/form-data; boundary=bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Length: 1938

       

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="language"

       

      en

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="authenticity_token"

       

      RnLa3dvuUT3zYIwthVRNfdLoiNvqQqaB

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="format"

       

      xml

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="full_keychain_key"

       

      54928d174d124f6c9ba5e2f8ea6fb09fbe88977f32f0ef86d4c76db6a9f46eaf115cd9c022534513a36c276e9b4af07018837f85c0bb5274c8d2faf5f5f74fb169c968fada3754fdda95804ce8b2e50e048b4d75f50d70e0c39ad5a37cc1827c2a3ac0eea4383c72af57f003ee0960129972601d92efb831794a70ad3be21238

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="full_keychain"; filename="foo"

      Content-Transfer-Encoding: binary

      Content-Type: application/octet

       

      ed0347e29da29b191a2051a6c2f1db3a7f8ea51747b26c246ddadeaddd6077cc2a4b3da4c0084247b72c836174e4b5c7074c75228c638b6ca20a837e18ccea4e9d874238af0e2b59c10f5cd5c3e38e8810c9c57fb7b95832ea4dd20ebd2c672756597dd6f2c7dd730df0c4b0057eb90c7e0d5f91b216661d

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="project_name"

       

      Default

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="no_overwrite"

       

      false

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="tabs_allowed"

       

      false

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="discard_keychain"

       

      false

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="name"

       

      Balance Settlement Details

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="compute_metadata"

       

      true

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="embed_oauth_credential"

       

      false

      --bf831fcb5f4c480ea53bb6f9cd3bd497

      Content-Disposition: form-data; name="include-files"

       

      true

      --bf831fcb5f4c480ea53bb6f9cd3bd497--

       

      Response

       

      HTTP/1.1 500 Internal Server Error

      Date: Tue, 10 Nov 2015 21:39:52 GMT

      Server: Tableau

      Pragma: no-cache

      Expires: Thu, 01 Jan 1970 00:00:00 GMT

      Cache-Control: no-cache

      Cache-Control: no-store

      Content-Type: application/xml;charset=utf-8

      P3P: CP="NON"

      X-UA-Compatible: IE=Edge

      Connection: close

      Transfer-Encoding: chunked

       

      ec

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

      <error xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

          <code>100</code>

          <message>Internal server error</message>

          <details>InvalidKeyException</details>

      </error>

      0