Skip to main content

Hi,

 

I have an ASP.NET web application in which i'm rendering different tableau dashboards from a site based on the the menu clicked by the user. I have multiple menus and each menu was tied to a tableau URL.

 

Tableau Trusted Authentication has been implemented to get the trusted ticket from the tableau server. Once the ticket has been retrieved, i am appending the ticket to the URL for each menu.

 

The trusted ticketing module is working fine and the visualizations are getting rendered in my web application. However, frequently i am getting a message of "Could not locate unexpired ticket" error.

 

On checking with this error, this is due to the ticket calls getting duplicated.

 

I reached out to the support regarding this and got response that I can add client_ip during my trusted ticketing.

 

http://kb.tableau.com/articles/Issue/error-could-not-locate-unexpired-trusted-ticket

 

I am not able to find any code article related to adding client_ip filtering in trusted ticketing.

 

Below is my trusted ticket code

 

public class TableauTicket

    {

        public string getTableauTicket(string tabserver, string sUsername)

        {

            try

            {

                ASCIIEncoding enc = new ASCIIEncoding();

                string postData = string.Empty;

                string resString = string.Empty;

 

                postData = "username=" + sUsername + "";

 

                // FEATURE 816 END - Custom Visualization - KV

                if (postData != string.Empty)

                {

                    byte[] data = enc.GetBytes(postData);

                    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(tabserver + "/trusted");

                    req.Method = "POST";

                    req.ContentType = "application/x-www-form-urlencoded;charset=UTF-8";

                    req.ContentLength = data.Length;

 

                    Stream outStream = req.GetRequestStream();

                    outStream.Write(data, 0, data.Length);

                    outStream.Close();

 

                    HttpWebResponse res = (HttpWebResponse)req.GetResponse();

                    StreamReader inStream = new StreamReader(stream: res.GetResponseStream(), encoding: enc);

                    resString = inStream.ReadToEnd();

                    inStream.Close();

 

                    return resString;

                }

                else

                {

                    resString = "User not authorised";

                    return resString;

                }

            }

            catch (Exception ex)

            {

                string resString = "User not authorised";

                return resString;

                string strTrailDesc = "Exception in tableau ticket - " + ex.Message;

            }

        }

        public int Double(int i)

        {

            return i * 2;

        }

    }

 

Can anyone please let me know how the client_ip can be passed in trusted ticketing code. Also the client ip will get changed for each user and how this will be handled in the trusted ticketing?

2 answers
  1. Dec 10, 2017, 6:44 AM

    Did you figure out the solution for this? I have the same requirement and i have enabled automatic  AD authentication So when they click the .net web application menu then this will intern call the tableau Page.

     

    Now I have another requirement is to display the one of the dashboard in TV screen. I am not sure how to authenticate user for the same . do you have any idea then please share the same .

0/9000