Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Div-integration: problem with ticket-authentication

I try to integrate an object from a qlikview-document in my php-website with div-integration.

First the user logs in my portal. During the login, the user gets a ticket from qv-server (tested, works properly). After that, the user redirects to another site, where the qv-object is integrated. But the object isn't shown.

The code of the php-site:

<?php

session_start();

?>

<!DOCTYPE html>

<html lang="de" xmlns:zfp="http://www.qliktech.com/zfp" xmlns="http://www.w3.org/1999/xhtml">

<head>

  <title>QV-Test Div Integration</title>

</head>

  <script language="javascript" type="text/javascript" src="http://<serveraddress>/QvAJAXZfc/htc/QvAjax.js"></script>

  <script language="javascript" type="text/javascript">

 

    Qv.InitWorkBench({

   View: 'SalesCompass',

   // Note: According to the documentation "Host: 'Local'" should be the default value,

   // but in my experience it seems to be more stable to use "Host: null" instead

   Host: '<servername>',

   Ticket: '<?php echo $_SESSION['webticket']; ?>'

    });

  </script>

  <style type="text/css">

  .QvFrame {

  position:relative;

  margin-left:10px;

  margin-right:10px;

  float:left;

  border: 1px solid #ff0000;

  width: 900px;

  height: 400px;

  z-index: 2;

  }

  </style>

<body>

Hello, <?php echo $_SESSION['user']; ?>

<br/><br/>

Webticket: <?php echo $_SESSION['webticket']; ?>

<br/><br/>

  <div class="QvFrame" avqview="SalesCompass" avq="object:.Document\CH378">

  </div>

</body>

</html>

The webserver-log:

02.05.2014 11:47:16.5232637InformationRequest received [POST]: http://<serveraddress>/QvAJAXZfc/GetWebTicket.aspx
02.05.2014 11:47:16.8040642InformationRequest received [GET]: http://<serveraddress>/QvAJAXZfc/htc/QvAjax.js
02.05.2014 11:47:16.9756645InformationRequest received [GET]: http://<serveraddress>/QvAJAXZfc/htc/default.css
02.05.2014 11:47:17.0380646InformationRequest received [POST]: http://<serveraddress>/QvAJAXZfc/QvsViewClient.aspx?mark=&host=<serveraddress>&ticket=a&view=SalesCompass&slot=&platform=WORKBENCH&dpi=96&xrfkey=PzSkyUb1VcbQDuwY
02.05.2014 11:47:17.0380646InformationCreate client: No User
02.05.2014 11:47:17.0380646InformationCreate client: Mode=Authenticate, Host=axeed-srv-01:4747, ClientIP=<ipaddress>, MachineId=64a2a9b7-36bb-4271-89a8-308391e6096d, Slot=
02.05.2014 11:47:17.0380646WarningFailed to get client: m_Sock.Receive throws zero
02.05.2014 11:47:17.0380646InformationCreate client: No User
02.05.2014 11:47:17.0380646InformationCreate client: Mode=Authenticate, Host=axeed-srv-01:4747, ClientIP=<ipaddress>, MachineId=f40efb76-bf0d-4740-9c90-1e2975f40efe, Slot=
02.05.2014 11:47:17.0380646WarningFailed to get client: m_Sock.Receive throws zero

any ideas, what I'm doing wrong? I use QV-Server 11.20 SR5 with Workbench-License.

Thanks in advance for help!

7 Replies
MichaelRobertshaw
Former Employee
Former Employee

Pass the ticket to your PHP page in the GET parameters.
If using the legacy ticket then add &ticket=etcetcetcetc
or if using WebTicket (much better) then you need to hop
to your page via authenticate.aspx

Not applicable
Author

Hi Simon,

I am also having same issue, how did u  solved your issue?

Please reply.

Thanks,

Not applicable
Author

Hi Simon,

There are 2 ways to generate tickets in QlikView, with GetWebTicket.aspx or GetTicket.aspx.

When you use GetTicket.aspx you can use the parameter ticket in the following statement:

    Qv.InitWorkBench ({

         View: 'SalesCompass'

         Host: '<servername>',

         Ticket: Ticket

     });

But When you used GetWebTicket.aspx you don´t need to pass the ticket parameter in QV.InitWorkbench.

You could try:

1) Get  Webticket for a User

   http://server/QvAjaxZfc/GetWebTicket.aspx?cmd=%3CGlobal%20method=%27GetWebTicket%27%3E%3CUserId%3Eus...

Ticket: VZndi/7Jbix6uUVvz1ioDGBrPXap+aukE2s5WgoD

2) Encode workbench web page URL

   Workbench page: http://server/workbench/

   Workbench page encoded : http%3A%2F%2Fserver%2Fworkbench%2F

   You can use URL Decoder/Encoder

3) Autenticate Workbench page with a ticket generated

   http://server/qvajaxzfc/authenticate.aspx?type=html

                                                                &try=http%3A%2F%2Fserver%2Fworkbench%2F         

                                                                &back=/Qlikview/

                                                                &webticket=VZndi/7Jbix6uUVvz1ioDGBrPXap+aukE2s5WgoD

If the authentication is successful QlikView  redirected to the Workbench page and it will display the corresponding qlikview objects only if the user is authorized to access to .qvw document containing such objects

Best Regards.

Pablo

Not applicable
Author

Hi Pablo,

Thank you for your reply. When I use GetTicket.aspx, ticket is not getting generated at all whatever I do, moreover I am trying to generate the ticket for logged in user only.

Really, I didnt get how to use your second method, as below is the way I am trying to implement workbnech in my html...

<html >

<head>

  <script language="javascript" type="text/javascript" src="/QVAJAXZfc/htc/QvAjax.js"></script>

  <script language="javascript" type="text/javascript">

  var qvDoc_LERG;

  Init_LERG = function() {

  qvDoc_LERG = Qv.GetDocument('CUSTOMER\\CUSTOMER_LERG');

  }

  Clear_LERG = function() {

  qvDoc_LERG.Clear();

  }

    Qv.InitWorkBench(

                  { View: 'CUSTOMER\\CUSTOMER_LERG'

  , Host: "Customer"

  //, Ticket: "${webticket}"

   , BodyOnLoadFunctionNames: ['Init_LERG','Clear_LERG'  ]  });

  </script

</head>

<body>

  <div class="report"  style="width:1210px;height:200px;>

  <div class="QvInlineObject" avqview="CUSTOMER\\CUSTOMER_LERG.qvw" avq="object:.Document\TB03"      id="Document\TB03" avqstyle="true"></div>

        </div>

</body>

</html>

I have generated webticket using GetWebTicket.asp on this page(html).

Please help me, how/where I need to authenticate workbench.

Thanks,

celindho
Partner - Creator
Partner - Creator

Hi,

Did you find a solution to this case?

BR,

-Christian

MichaelRobertshaw
Former Employee
Former Employee

Pablo's guidance from Dec 2014 is correct. The ticket parameter in Qv.InitWorkBench() is NOT a WebTicket. It is a legacy Ticket that is valid for interaction with a single document. As such, it should be retrieved from GetTicket.aspx NOT from GetWebTicket.aspx.

The response from GetWebTicket.aspx is a junk string that is a handle to a Session Object on the WebServer that produced it. This has to be delivered to Authenticate.aspx (at the same webserver) which will redirect the user to the URL Encoded TRY parameter and at the same time will deliver the AccessPointSession session cookie to the browser. That cookie provides identity to all QlikView pages in that browser session. So, if you have retrieved a WebTicket, you can redirect via Authenticate.aspx to the page containing the DIV tags (and any other QlikView page) and do not include the ticket parameter in Qv.InitWorkBench() because identity has already been supplied in that cookie. If you have retrieved a Ticket from GetTicket.aspx then it is valid for single use for a single QVW, and should be included in either the GET parameters of the page containing the DIV tags, or provided when invoking Qv.InitWorkBench()

celindho
Partner - Creator
Partner - Creator

Thanks Michael!