I can see that there are not many Tableau experts around StackOverflow, but maybe some of them have already encountered this problem and know this solution. I am a complete Noob at Tableau, so please forgive me if this question is insane. Thanks in advance!
System
Tableau installation method is located on the server separately from the web server. The application is written in PHP using CakePHP 2.2.0 stable.
10.0.0.10 - webserver 10.0.0.11 - tableau
In order for the client to view the report created in Tableau, we use a reliable ticket verification system where the client is given a URL with a specific ticket. The client then uses this ticket to request the table server directly for the report.
Example:
- GETS client http://example.com/reports/view/3 - internal 10.0.0.10.
- Server POSTS up to 10.0.0.11 and requests a ticket to view client report 3
- The Tableau server responds to the message with a number, for example. 987654321.
- The server responds to the GET client on the page, including the ticket.
- GETS Client http://tableau.example.com/trusted/987654321/view3
- The Tableau server checks the client's IP address on the ticket and responds to the HTML report.
Problem
The problem is this: when the code asks for the ticket number of the table (steps 2 and 3 above), the Tableau server responds to the authentication page, not the ticket identifier. If I comment out the "target_site" parameter in the $ postdata array, the table does not respond to the login page and instead simply says "-1".
PHP code to create a trusted URL:
<?php public function get_trusted_url($view = 'book2sheet1') { $email = $this->Auth->user(); $email = $email['Email']; //This email is registered as a Tableau user! $postdata = http_build_query( array( 'username' => $email, 'target_site' => 'oursite', //If I comment this line out, Tableau no longer returns an auth page and instead simply returns "-1" 'client_ip' => $_SERVER['REMOTE_ADDR'] ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $ticket = file_get_contents('http://10.0.0.11/trusted/', false, $context); if($ticket > 0) { return 'http://tableau.example.com/t/rg/trusted/' . $ticket . '/' .$view . '?:embed=yes&:comments=no&:toolbar=yes'; } else { echo 'failure'; //debug print_r($ticket); //debug - this prints out the auth page return false; } }
Any help would be greatly appreciated! As I mentioned, I'm a complete noob in Tableau :)
Image of the returned html login dumped to the page using print_r('ticket')

Thanks!
source share