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

Can't get the Get Ticket authentication example to work with QlikView 10

Does anyone have a working get ticket example that works with QlikView 10 or can give me a pointer as to what I'm doing wrong? The example that's included in the Authentication section from the SDK refuses to return a ticket for me. All it did was give me a blank alert box when I clicked on the "Ticket" button after I replaced the server and user placeholders.

Here is what I'm trying to do:

The url I'm passing in is http://ServerName/QvAJAXZfc/qvsviewclient.aspx?admin=<Global method="GetTicket"><UserId>AnotherUser</UserId></Global>

"ServerName" is the name of our server and "AnotherUser" is a valid user.

I can see the initial xmlhttp.open's POST request in the server log but all it does is return a "Empty Request" in the result message text. The same happens with a GET.

If I use http://ServerName/QvAJAXZfc/qvsviewclient.aspx?cmd=<Global method="GetTicket"><UserId>AnotherUser</UserId></Global> with the same parameters, I get a "failed to open document, file not found" error in the resulting XML.

Finally, if I first run http://ServerName/QvAJAXZfc/Authenticate.aspx and then run the second url, I still get the same error in the returned XML but on the server log, it does create a client and issue a ticket. However, the client is using my username and not the one from parameter I passed in, "AnotherUser".

Thanks for any help on this matter.

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try using GetTicket.aspx instead of qvsviewclient.aspx and I think it should throw a ticket back to you correctly.

View solution in original post

10 Replies
Anonymous
Not applicable
Author

Try using GetTicket.aspx instead of qvsviewclient.aspx and I think it should throw a ticket back to you correctly.

Not applicable
Author

Got it working with getticket.aspx using the cmd parameter. Thanks!

Not applicable
Author

Can any of you provide the full working syntax your using for this. I'm trying to use the ticket approach in a ASP.NET C# application and keep getting the: <message text="Invalid call" /> return if I use getticket.aspx

If I use qvsviewclient.aspx then i get the <message text="no connection" /> error.

Any help is much appreciated as I have been stuck for days.

Using IIS and was using the impersonation for asp.net

Not applicable
Author

Look at Johannes' example (http://community.qlik.com/media/p/144538.aspx) with Reflector.NET (http://www.red-gate.com/products/dotnet-development/reflector/)

The code is similar to:


private void button1_Click(object sender, EventArgs e) { WebRequest request = WebRequest. Create("http://" + this. textBox4. Text + "/QvAjaxZfc/GetTicket.aspx?admin="); string str = "<Global method='GetTicket'><UserId>" + this. textBox1. Text + "</UserId></Global>"; request. ContentLength = str. Length; request. Method = "POST"; request. Credentials = new NetworkCredential(this. textBox3. Text, this. maskedTextBox1. Text); StreamWriter writer = new StreamWriter(request. GetRequestStream()); writer. Write(str); writer. Flush(); try { StreamReader reader = new StreamReader(request. GetResponse(). GetResponseStream()); XmlDocument document = new XmlDocument(); document. LoadXml(reader. ReadToEnd()); if (document. InnerText. Length <= 0) { throw new Exception("Check QVS Host name / availability"); } this. textBox2. Text = document. InnerText; } catch (Exception exception) { this. textBox2. Text = exception. Message. ToString(); } }


Don't forget that you need to be in the "Qlikview Administrator" Group to successfully execute this code + get a ticket from QVS!

Not applicable
Author

Thanks for the fast response. I will look at all this again and try what you suggested. I was already using the code from the link: (http://community.qlik.com/media/p/144538.aspx) and while debugging I see the code get to the line: if (document.InnerText.Length <=0) and it is always equal to zero.



I wonder if this is an issue with my IIS setup. We have the QVWS disabled and using an IIS virtual directory which is on a web server that has other sites hosted.

-Can you confirm what my IIS settings need to be for Authentication? (IIS7). Enable Annonymous, impersenation?

-The user I'm impersenating is in the QV administrators group but they are a local admin of the web server and the box is not on a domain.

-I have QV setup to use DMS security and created a custom directory with a user called "user". That is the user I'm passing in the get ticket XML tags

Thank you so much for any other information you can provide as I have lost some major sleep over this one.

Not applicable
Author

Mine is almost exactly the same as the one that rva posted in addition to passing the credentials of a qlikview administrator so that the call can be completed successfully. The IIS settings were all default settings for the website that was created on the machine that's hosting the app.

Also, have you tried looking at the QV server log files? When you do the post command, it will show up in the log files and assuming your program is running under the right credentials, it will also display the returned ticket XML in there.

Not applicable
Author

I'll Check the logs thanks for that heads up.

I started thinking that maybe I'm making this harder then it needs to be. We have a demo for a potential customer and this Security doesn't need to really be fully setup. I just need the ability to have a user click a link in our ASP.NET c# application and have it open a .qvw using AJAX. Is there anyway to just bypass security and have this work for the demo? I can then dig more into all the proper ways to setup security when we are to roll this out months from now.

I can use Access Point and when I find the direct link to the .qvw object I want I copied that into my asp.net project and made a html link for it. The only issue is that I'm prompted everytime with a windows login box asking for username password. If I enter my Admin user into that I eventually can see the report but I'm really trying to not have the login box appear. Anyone have any ideas on a quick easy way to make this look seamless for the demo?

Not applicable
Author

In the code that rva posted, instead of typing in the login info from the textboxes, hard code the login and password?

Not applicable
Author

@jamesiv

Are you using IE for your demo?

IE normally hands over the username automatically without showing a loginbox due to WindowsIntegratedSecurity! (Firefox, Opera does).

If you are using IE and it does not work, try the following:

- Add the Qlikview website to your trusted sites (or Intranet site) in IE
- Check your IE settings> Security, Intranet Zone you should find a advanced setting similar to the german "Automatische Anmeldung mit akutellem Benutzername und Kennwort"