6 Replies Latest reply on Jan 5, 2016 8:47 PM by frank.bracco

    responsive iframe + Tableau trusted authentication (php)

    JOSEPH PRICE

      I'm embedding Tableau views in a PHP web application.  We had been using an enabled guest account with Tableau Server which basically allowed for anonymous authentication.  Under this scheme, responsive embeds were straightforward, and working great, using a javascript solution such as fitvids.js/fluidvids.js.

       

      Recently, we made the change to trusted authentication which passes a specific user to Tableau Server from the web app, generates a unique, one-time trusted ticket, and renders the view.  With a standard, fixed embed, everything works as expected.  However, when implementing fitvids.js or fluidvids.js, we get the dreaded Tableau error: Could not locate unexpired trusted ticket.

       

      My best guesses are that the breakdown is either:

       

      1. PHP for ticket generation and url creation

      2. processing order of javascript (most likely)

      3. Tableau Server limitation

       

      For reference, the php in question is attached along with a sample embed snippet.

       

      This also made its way onto php - responsive iframe + Tableau trusted authentication - Stack Overflow

        • 1. Re: responsive iframe + Tableau trusted authentication (php)
          Russell Christopher

          Hey Joseph -

           

          I'd back up a bit and make sure that trusted tickets are working at all for you - have you tested this? Are you sure that you are getting "real" tickets back from Tableau Server.

          • 2. Re: responsive iframe + Tableau trusted authentication (php)
            JOSEPH PRICE

            Hey Russell,

             

            I can indeed confirm that trusted tickets are working properly...when using width and height for the iframe style.  If you'd like a test account in our web app to confirm, I'd be happy to grant you access. 

             

            FWIW, your stackoverflow answers on trusted authentication were extremely helpful, so i was hoping you'd chime in on this question! 

            • 3. Re: responsive iframe + Tableau trusted authentication (php)
              Russell Christopher

              If Trusted Tickets works with an iFRAME (with hardcoded height and width) than #1 above can't be the case, right? Either the ticket generation & URL creation works, or it doesn't. No reason it would break unless you changed the code.

               

              #2 could be the case. Are you using a tool like Firebug or Fiddler to see if your frame is executing the URL (with embedded ticket) multiple times? That's not allowed - a ticket can only be redeemed once. So the "could not find unexpired ticket" message could just be the js behind the iframe re-submitting stuff unnecessarily.

               

              if this is the case, you'll need to find a plug-in that doesn't re-submit the ticket over and over...or you'll need to hack the code somehow so that BEFORE it does, you call your code to generate a trusted ticket again and plug a new value into the code.

               

              HTH?

              1 of 1 people found this helpful
              • 4. Re: responsive iframe + Tableau trusted authentication (php)
                JOSEPH PRICE

                Good call on Fiddler.  I should have thought to do just that.  And it reveals precisely the problem. 

                 

                With a fixed proportion embed, there is a single request to the trusted ticket url:

                1. /content/demo-tableau-trusted
                2. /trusted/Sz1y2Beu6Wr2EZnIg37-7oPm/t/education/views/Attendance/AttendanceDashboard?:embed=yes&:toolbar=yes:tabs=no
                3. /t/education/views/Attendance/AttendanceDashboard?:embed=yes&:toolbar=yes:tabs=no

                 

                And then with a javascript solution (FluidVids in this case), there are two requests to the same trusted ticket url:

                1. /content/demo-tableau-trusted
                2. /trusted/eg93TnSj0SQuhoCdHJbh0t94/t/education/views/Attendance/AttendanceDashboard?:embed=yes&:toolbar=yes:tabs=no
                3. /trusted/eg93TnSj0SQuhoCdHJbh0t94/t/education/views/Attendance/AttendanceDashboard?:embed=yes&:toolbar=yes:tabs=no

                 

                I should be able to find a solution and report back now that I know where to focus my efforts.  Thanks a ton for your help

                • 5. Re: responsive iframe + Tableau trusted authentication (php)
                  JOSEPH PRICE

                  I scrapped the javascript route and went for an html/css only solution.  Thanks Russell for steering me in the right direction. 

                  • 6. Re: responsive iframe + Tableau trusted authentication (php)
                    frank.bracco

                    do you happen to have a live example somewhere the interwebs you would be willing to share? Would be interested in seeing how this all turned out.