0 Replies Latest reply on Aug 30, 2013 12:20 PM by Anthony Krinsky

    Trusted Tickets java servlet/JSP code sample

    Anthony Krinsky

      The following code is provided “as-is” without guarantees whatsoever to support the trusted tickets workflow.

       

      This includes a simple ticket generator as well as an on-demand view dispatcher with cookie check.

       

      The is in the attachments below.  Revisions, suggestions welcome.

       

      For help, email Anthony Krinsky (akrinsky@tableausoftware.com)

       

      In PHP the code is simply:

       

        $user=$_GET["user"];

        $wgserver=$_GET["host_url"];

        $remote_addr=$_SERVER['REMOTE_ADDR'];

        $params = array(

         'username' => $user,

         'client_ip' => $remote_addr

        );

       

      echo
      http_parse_message(http_post_fields($wgserver."/trusted",
      $params))->body;

       

        Java Libs required

      The following libraries are leveraged for http socket calls
      in java.

       

      • commons-lang-2.6.jar
      • commons-logging-1.1.1.jar
      • httpclient-4.2.5.jar
      • httpcore-4.2.4.jar