5 Replies Latest reply on Oct 1, 2013 4:13 AM by Russell Christopher

    Authentication Issue at first load Using JS's API

    Sk Safi

      HI Team,

       

      I am facing below mentioned issue at the time of first load of the HTML file.

       

      1.The browser asking for authentication and  after giving credentials it's going to the  main page of the server where the Tableau views 

          are  published.Second time the HTML file  is working fine.

          But it should open the specific url (mentioned in HTML file) first time also.

      2. Some times the options (mentioned in API e.x: hideTabs: true) are not working and all the tab is coming.

       

       

      Please give some light on the mentioned issue.

       

       

      Thanks & Regards,

      Safi

        • 1. Re: Authentication Issue at first load Using JS's API
          Russell Christopher

          Can you post your source code, please?

          • 3. Re: Authentication Issue at first load Using JS's API
            Russell Christopher

            Hey SK -

             

            I just tried this out against my server (8.04) and am not seeing any issues - Since I don't have your workbook I just used a sample out on my box. I also commented out your ShowOnly() function since my workbook doesn't have the same fields with which to filter.

             

            Question:

             

            • Are you seeing this every time you start a fresh browser session? I tried to repro in Chrome, IE, and Firefox, and it worked across the board for me. Browser specific for you?
            • Are you running the html/js from a local folder, or hitting it via a web server? Does it make a difference?

             

            FYI - you might want to consider not using ShowOnly() in onFirstInteractive - by doing so, you force the user to wait for the report to render, and only THEN filter it. You can filter it right up front so the user doesn't need to wait twice:

             

              var mainVizOptions = {

                    hideTabs: false,

                    hideToolbar: false,

                    width: mainVizDiv.parent().innerWidth() + "px",

                    height: mainVizDiv.parent().innerHeight() + "px",

                    //Filter Category field - note NO spaces between multiple filter values. Just a comma

                    Category: "Office Supplies,Furniture",

                    //Set Top Customers Parameter Value - note wrapping quotes around parameter name since it contains spaces

                    "Top Customers": 22,

                    onFirstInteractive: function () {

                        mainWorkbook = mainViz.getWorkbook();

                    }

             

            You could set your "Region" filter up front and avoid the cost of re-filtering.

            • 4. Re: Authentication Issue at first load Using JS's API
              Sk Safi

              Hi Russell,

               

              PFB some points regarding your question.

               

              1.It's browser specific and the browser is Safari.

              2.I am just running the html file using Safari 6.0.1.

              3.At every  fresh session the page is going to authentication page but not redirecting to our html page containing the view.And it's just opening the url (only the dashboard is opening with out API).

              4.I am using ShowOnly() function in onFirstInteractive for below mentioned reason.

                 --> Using API I am creating different links for different dashboards.

                ---> I have a filter for Region.

                       Now if 'JPAC' is selected in filter and then I switch the dashboard then the dashboard with the region which   

                       was  selected at the time of publish will be loaded.(Ex. The Region was 'Americas ' when the dashboard was

                        published ).

                       But it should come only for 'JPAC' dynamically.

               

              Thanks,

              Safi

              • 5. Re: Authentication Issue at first load Using JS's API
                Russell Christopher

                Thanks -

                 

                I'd open up a support case to cover points 1-3: It should work the same way across all browsers, so I'd guess this is a bug, unless Safari is doing something to block cookies that the other browsers don't do. 

                 

                When you open the case, I'd be very specific that the issue is not your code, but running the code inside Safari. Product Support will probably ask you for a repro, so if you have a minute, I'd advise you to put together a very, very simple web page which points to one of the Tableau Sample workbooks already on the Server. That way support can just change the server name and immediately see what's going on. Feel free to post a case number here and I'll add some notes to it to help them along.

                 

                On #4 - Understood. You could still add some logic to add an option to filter only under certain circumstances - That would allow you to filter when appropriate as the report is first rendered (vs afterwards, in onFirstInteractive). Not a big deal one way or the other, but doing any filtering that is necessary "up front" vs. in onFirstInteractive will make for an improved user experience.

                 

                Good luck!