4 Replies Latest reply: Jan 7, 2017 5:08 AM by Martins Dermanis RSS

    Why is our Qlik server disconnecting users after multiple log in attempts?

    Martins Dermanis

      We use Qlik Sense API (Qlik ver. 3.1.4) to get Qlik Objects to our Asp.Net MVC  site and then display them there. The problem is that, for first couple times (the amount seems to vary) that the user logs in on our site, the app works fine. However, when the user logs out and logs in many times in a row, an exception is raised (the requests are sent through a RestSharp client):

       

      qlik1.png

       

      Also, sometimes we get an error message "The specified virtual proxy prefix [Our Prefix] was illegal for TargetId [Ticket Target Id]". This seems to be happening individually on a per browser basis. For an example, currently on my PC I am getting these errors on Chrome, but the site works fine on Firefox (because I did not log out - log in there). However the issue did persist over multiple users. A new user did not seem to fix the issue on the Chrome browser. Deleting the cookies for both the Asp.Net application and the Qlik seemed to change nothing. In case we are doing something wrong with the sessions, here is how logging out is done:

       

      var result = qlikRestClient.Request(qpsPath, "user/"+settings.UserDirectory+"/"+ username, Method.DELETE);

       

      And here is the authentication method (using tickets):

       

      public ActionResult Authenticate(string proxyRestUri, string targetId)

              {

                  var pFrom = proxyRestUri.IndexOf("qps/") + "qps/".Length;

                  var pTo = proxyRestUri.LastIndexOf("/");

                  var prefix = proxyRestUri.Substring(pFrom, pTo - pFrom);

                  var settings = repo.GetAll().FirstOrDefault(s => s.Prefix.ToLower() == prefix.ToLower());

       

       

                  var ticket = proxy.GetTicket(User, settings, targetId);

                  if (ticket == null)

                  {

                      throw new Exception(string.Format("Could not receive Qlik Ticket for user {0}", User.Identity.Name));

                  }

                  var separator = ticket.TargetUri.IndexOf("?") > 0 ? "&" : "?";

                  var url = ticket.TargetUri + separator + "QlikTicket=" + ticket.Ticket;

       

       

                  return Redirect(url);

              }

       

      Also tickets seem to be generated for each document we get from Qlik, such as qlik-styles.css, require.js, qlik.js and a couple others. Also, if break points are applied in between the tickets, the sixth ticket seems to cause a disconnect with Qlik (an alert appears in the browser). Any ideas on how to fix this?

        • Re: Why is our Qlik server disconnecting users after multiple log in attempts?
          Alexander Karlsson

          A user can only log in 5 times hence you are seeing the error on the 6th connection attempt.
          If they are using the same device do not log them in every time, instead retain the session and perform a session check before requesting a new ticket.

            • Re: Why is our Qlik server disconnecting users after multiple log in attempts?
              Martins Dermanis

              Thanks for the response. We have refactored one of our projects to only request one ticket (the initial require.js request is done in Asp.Net MVC and the rest of the requests are done using require inside jQuery). The authentication module is triggered only once. However, the problem still persists in the same exact way. After a couple times logging in and logging out, the page breaks. Also, if the problem was just the tickets exceeding the allowed session count, wouldn't the site not work every time, instead of breaking after a couple times of relogging into the site? In the browser console we see this output:

               

              upload.png

              Thanks in advance for any support you may give us.

                • Re: Why is our Qlik server disconnecting users after multiple log in attempts?
                  Alexander Karlsson

                  If I'm not mistaken there is also a license abuse timer in place so logging out will log out the user but the session is still "active" towards the license timer.

                   

                  It could also be something else entirely but since you stated that it's usually around the 6th attempt it breaks it sounds like it could be the cause of the error.

                    • Re: Why is our Qlik server disconnecting users after multiple log in attempts?
                      Martins Dermanis

                      Thanks for the reply. In the project I am working on, we still have multiple tickets being received, however in my colleague's project there is only one ticket and the authentication module gets triggered once. In my project, I can quite easily see, that the problems start at the sixth attempt. However, in my colleague's project, it is less noticeable (because the ticket is acquired only once and that acquisition works fine), but the browser console errors are more or less the same (so it seems to ultimately be the same problem).

                       

                      As for the license timer, how does it work? After spamming my Chrome browser with huge amounts of these relog attempts (while researching what the problem is), it became inaccessible for 2 days now. So does the license timer have a cumulative effect? Or could it be something else?