Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
SVAS
Contributor II
Contributor II

.NET SDK - error message "Ticket retrieval failed"

Hi.

I'm a newbie on the .NET SDK approach so I'm trying to use  Øystein Kolsrud example on github (https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage) as a baseline so I can make my own solution. For this reason, first, I was trying to test his example to check if I could connect with my Qlik Sense server, but unfortunately, I'm getting the error message: "Ticket retrieval failed".

Additional information:  I have a virtual proxy where I have selected the ticket as the authentication method.

I have also checked the https://community.qlik.com/t5/Integration-Extension-APIs/quot-Ticket-retrieval-failed-quot-when-tryi... but unfortunately it didn't help.

 

private static ILocation ConnectToDesktop()
        {
            var location = Location.FromUri(new Uri("https://mydomain.com"));
            location.AsDirectConnectionToPersonalEdition();
            location.AsNtlmUserViaProxy(proxyUsesSsl: false);
            return location;
        }

private static void Main(string[] args)
        {
            using (var hub = ConnectToDesktop().Hub()) <--- crashes in here
            {
                var theApp = PrepareApp(hub);
                HyperCubeExamples(theApp);
                Paging(theApp);
                MultipleHyperCubesExamples(theApp);
            }
        }

 

Error:

 

Error:
System.Security.Authentication.AuthenticationException 
Message=Ticket retrieval failed. 
Source=Qlik.Engine 

StackTrace: 
at Qlik.Engine.Communication.QlikConnection.AwaitResponseTask[T](T task, String methodName, CancellationToken cancellationToken) 
at Qlik.Engine.Communication.QlikConnection.AwaitResponse(Task task, String methodName, CancellationToken cancellationToken) 
at Qlik.Engine.Communication.QlikConnection.Ping() 
at Qlik.Engine.LocationExtensions.DisposeOnError(IDisposable o, Action f) 
at Qlik.Engine.LocationExtensions.Hub(ILocation location, ISession session) 
at HypercubeUsage.Program.Main(String[] args)

 

Really appreciate any help.

Thanks in advance.

Labels (1)
5 Replies
Øystein_Kolsrud
Employee
Employee

Hi! It looks like you are configuring your connection as both "AsDirectConnectionToPersonalEdition" and "AsNtlmUserViaProxy". You should probably remove the first one.

And since you are using the "proxyUsesSsl"-argument you must be using a relatively old version of the SDK (it was deprecated in v15.2.1) so you might want to go to a more resent version and see if it works there.

But you say you have a "virtual proxy where I have selected the ticket as the authentication method". Perhaps you simply need to use the proxy in the path like this?

var location = Location.FromUri(new Uri("https://mydomain.com/myproxy"));

 

SVAS
Contributor II
Contributor II
Author

 

var location = Location.FromUri(new Uri("https://mydomain.com"));
//var location = Location.FromUri(new Uri("https://mydomain.com/myproxy"));
location.VirtualProxyPath = "myproxy";
location.AsNtlmUserViaProxy();

 

Could it be because I'm using the ticket as the authentication method? I'm asking this because in the QMC when I allow anonymous users and  put the code like this it works:

 

var location = Location.FromUri(new Uri("https://mydomain.com/myproxy"));
location.AsAnonymousUserViaProxy();

 

I have also tried to extract ticket from cookies but it only worked when it was anonymous. If I change it to not allow anonymous user it doesn't work.

Unfortunately, and despite working, I cannot use it as anonymous.

I'm trying to do a restful api (.Net Core Web Api) to connect and get the data from Qlik and communicate with the frontend to display the results.

Sorry for the newbie questions, but from your experience should I use a virtual proxy? what should be the authentication method that I should use?

Thank you again for your help and please let  me know if you have any suggestion.

Øystein_Kolsrud
Employee
Employee

So anonymous connection works, but not NTLM? Do you know if your proxy uses Kerberos authentication? There's a checkbox for this in the "Ports" section of the "Proxies" configuration.

SVAS
Contributor II
Contributor II
Author

I have checked and it doesn't - the Kerberos authentication checkbox is unchecked. 

Øystein_Kolsrud
Employee
Employee

OK, that could have complicated things. But just to be sure I understand you correctly, you have a virtual proxy using "Ticket" authentication with "Windows" pattern? And that same virtual proxy also allows anonymous connection? Or are these two different virtual proxies?

And then you say that this works:

 

var location = Location.FromUri("https://mydomain.com/myproxy");
location.AsAnonymousUserViaProxy();

 

But this doesn't?:

 

var location = Location.FromUri("https://mydomain.com/myproxy");
location.AsNtlmUserViaProxy();