# Windows authentication

**URL:** <https://forum.katalon.com/t/windows-authentication/9982>\
**Category:** Miscellaneous\
**Created:** [March 28, 2018, 12:04pm UTC](https://forum.katalon.com/t/windows-authentication/9982 "2018-03-28T12:04:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajat\_vk](https://avatars.discourse-cdn.com/v4/letter/r/48db29/32.png) [@rajat\_vk](https://forum.katalon.com/u/rajat_vk)\
**Post date:** [March 28, 2018, 12:04pm UTC](https://forum.katalon.com/t/windows-authentication/9982/1 "2018-03-28T12:04:01Z")

</div>

I have an issue regarding windows authentication in my web applications.i have mentioned the code as WebUI.authenticate(‘URL’,‘Username’,‘Password’,Timeout which i mentioned as 12). When I run the code , its navigating to the home page but after that its stucks showing following error “Test Cases/New Test Case FAILED because (of) Unable to navigate to authenticated page (Root cause: Unable to navigate to authenticated page)”.

---

<div class="post-metadata">

**Author:** ![lukas\_krombholz](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@lukas\_krombholz](https://forum.katalon.com/u/lukas_krombholz)\
**Post date:** [March 29, 2018, 6:51am UTC](https://forum.katalon.com/t/windows-authentication/9982/2 "2018-03-29T06:51:01Z")

</div>

Having the exact same issue… I would really appreciate any help at this.

---

<div class="post-metadata">

**Author:** ![Peter\_Bailey](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@Peter\_Bailey](https://forum.katalon.com/u/Peter_Bailey)\
**Post date:** [March 30, 2018, 7:47pm UTC](https://forum.katalon.com/t/windows-authentication/9982/3 "2018-03-30T19:47:50Z")

</div>

I’m able to run test cases on an internal web app with Windows Auth without calling WebUI.authenticate – I just call WebUI.navigateToUrl(‘[http://test.ourlocalapp.com/](http://test.ourlocalapp.com/)’) and it opens up as the user who’s running Katalon. Are you using WebUI.authenticate to log in as a different user?

---

<div class="post-metadata">

**Author:** ![Hutami\_Septiana\_Rasw](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@Hutami\_Septiana\_Rasw](https://forum.katalon.com/u/Hutami_Septiana_Rasw)\
**Post date:** [May 9, 2018, 9:15am UTC](https://forum.katalon.com/t/windows-authentication/9982/4 "2018-05-09T09:15:01Z")

</div>

I have the same issue here. Really need some help and solution, thank you!

---

<div class="post-metadata">

**Author:** ![Sascha\_Cappel](https://avatars.discourse-cdn.com/v4/letter/s/71e660/32.png) [@Sascha\_Cappel](https://forum.katalon.com/u/Sascha_Cappel)\
**Post date:** [October 26, 2018, 3:50pm UTC](https://forum.katalon.com/t/windows-authentication/9982/5 "2018-10-26T15:50:02Z")

</div>

I have a small web appilcation using the only the default windows authentication of IIS in Win10 and have an issue with FF. In Chrome the test can authenticate and run all needed steps, but in FF it fails for the authentication step.

Also to succeed with Chrome I had to set "FailureHandling.CONTINUE\_ON\_FAILURE)  
" for the “Authenticate” function. I guess that’t not the intended way to run w eb application using default windows authentication.

Does anybody know a workaround, or is there any other function or setting as “Authenticate” to logon successfully using the default IIS windows authentication?

---

<div class="post-metadata">

**Author:** ![Michael\_Hampson](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@Michael\_Hampson](https://forum.katalon.com/u/Michael_Hampson)\
**Post date:** [October 26, 2018, 7:41pm UTC](https://forum.katalon.com/t/windows-authentication/9982/6 "2018-10-26T19:41:26Z")

</div>

> Sascha Cappel said:
> 
> I have a small web appilcation using the only the default windows authentication of IIS in Win10 and have an issue with FF. In Chrome the test can authenticate and run all needed steps, but in FF it fails for the authentication step.
> 
> Also to succeed with Chrome I had to set "FailureHandling.CONTINUE\_ON\_FAILURE)  
> " for the “Authenticate” function. I guess that’t not the intended way to run w eb application using default windows authentication.
> 
> Does anybody know a workaround, or is there any other function or setting as “Authenticate” to logon successfully using the default IIS windows authentication?

My site uses a popup window that I believe is the default authentication for IIS in Win 10 (running on chrome though) that webui.authenticate was having problems with. I use some custom javascript which opens the page, then a customkeyword script which does the authentication. Maybe some of this will work for you.

Heres the javascript call you make in the test case:

```auto
WebUI.executeJavaScript('function myFunction() { setTimeout(function(){ window.location.href = \'https://domainurl.com'; }, 500);}; myFunction()', [])

```

And here’s the custom keyword part

Call in test case:

```auto
CustomKeywords.'auth_package.auth_keyword.loginAuthenticate'(Username, Password)

```

which executes the keyword ‘auth\_package’:

```auto
package auth_packageimport static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpointimport static com.kms.katalon.core.testcase.TestCaseFactory.findTestCaseimport static com.kms.katalon.core.testdata.TestDataFactory.findTestDataimport static com.kms.katalon.core.testobject.ObjectRepository.findTestObjectimport com.kms.katalon.core.annotation.Keywordimport com.kms.katalon.core.checkpoint.Checkpointimport com.kms.katalon.core.checkpoint.CheckpointFactoryimport com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywordsimport com.kms.katalon.core.model.FailureHandlingimport com.kms.katalon.core.testcase.TestCaseimport com.kms.katalon.core.testcase.TestCaseFactoryimport com.kms.katalon.core.testdata.TestDataimport com.kms.katalon.core.testdata.TestDataFactoryimport com.kms.katalon.core.testobject.ObjectRepositoryimport com.kms.katalon.core.testobject.TestObjectimport com.kms.katalon.core.webservice.keyword.WSBuiltInKeywordsimport com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywordsimport internal.GlobalVariableimport MobileBuiltInKeywords as Mobileimport WSBuiltInKeywords as WSimport WebUiBuiltInKeywords as WebUIimport java.awt.Robotimport java.awt.Toolkitimport java.awt.datatransfer.StringSelectionimport java.awt.event.KeyEventimport java.awt.MouseInfoimport java.awt.Pointimport java.awt.PointerInfoimport java.awt.event.InputEventimport java.awt.datatransfer.Clipboard;import java.awt.datatransfer.DataFlavor;public class auth_keyword {	@Keyword	def loginAuthenticate(String username, String password) { Robot robot = new Robot(); robot.setAutoDelay(350); StringSelection ss = new StringSelection(username); Toolkit toolkit = Toolkit.getDefaultToolkit() Clipboard clipboard = toolkit.getSystemClipboard().setContents(ss, null); robot.delay(2000); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); ss = new StringSelection(password); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_TAB); robot.keyRelease(KeyEvent.VK_TAB); robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER);	}}

```

---

<div class="post-metadata">

**Author:** ![Galina\_Moore](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@Galina\_Moore](https://forum.katalon.com/u/Galina_Moore)\
**Post date:** [October 26, 2018, 8:21pm UTC](https://forum.katalon.com/t/windows-authentication/9982/7 "2018-10-26T20:21:02Z")

</div>

I’ve been using the solution described here and it’s worked well for me:

> **[Using autoIT for authentication in Katalon Studio](https://docs.katalon.com/katalon-studio/docs/using-autoit-for-authentication-in-katalon-studio.html)**
>
> WebUI.authenticate keyword in Katalon Studio would work well on Firefox browser, but the function might not work on other browsers due to unknown reasons. This guide will provide you a...
