This article will demonstrate a simple code change that you can implement to automatically prepend a domain name to a username during a web form authentication logon!
I'm a big fan of using form login authentication whenever possible. In today's modern world, when most users access business intelligence reports at least occasionally from mobile devices, an HTML web form is much more attractive than a pop-up credential prompt. The advantages of web forms range from aesthetic (you can brand them with your corporate colors and logo!) to functional (users are prompted to re-login when their token expires in a much more stable way). However, in most enterprise environments, presenting a web form requires users to enter credentials in domain\username format, which is often cumbersome, especially when typing on your phone or tablet's keyboard. The following is a simple "hack" to automatically prepend the domain\ portion, leaving users free to just enter their username.
Only a single file needs to be modified. Navigate to your Web folder (default path: C:\Program Files\QlikView\Web). Open the file FormLogin.htm in a text editor (create a backup of this file prior to modifying it). Prior to the closing tag, add the following lines of code:
Next, locate the line that begins with the opening form tag <form and replace that entire line with the following:
Change the domain variable value in the above code to the actual domain that you want to prepend and then save and close the file. When the user enters his/her credentials and presses the Submit button
the code that we just added with automatically prepend the appropriate domain, if it has not already been entered:
A final note: the solution in this article is applicable only to forms-based authentication and cannot be applied with automatic browser authentication used in combination with Windows Authentication (i.e. QlikView's default login scheme). The technical reason behind that is that browser-based authentication occurs between the client and the domain controller (when the browser retrieves the Kerberos token or NTLM hash string), not between the client and the web server.
As always, happy Qliking!