Skip to content
Advertisement

How to Handle the Windows Authentication in Linux Machine?

1.I launch my Application 2. It will ask for my Azure email ID for Authentioncation, Once its provided . 3. Then it will ask for Windows “username” and “password” for Authentication 4.In Linux how to Handle this windows Authentication ???

Help me out on how to handle this .I tried the below code .

But its Not working .

Robot rb = new Robot();
  //Enter user name by ctrl-v
 StringSelection username = new StringSelection("XXXXx");      Toolkit.getDefaultToolkit().getSystemClipboard().setContents(username, null);            
rb.keyPress(KeyEvent.VK_CONTROL);
rb.keyPress(KeyEvent.VK_V);      
 //tab to password entry field
 rb.keyRelease(KeyEvent.VK_TAB);
 Thread.sleep(2000);
  //Enter password by ctrl-v
 StringSelection pwd = new StringSelection("YYYY");
 Toolkit.getDefaultToolkit().getSystemClipboard().setContents(pwd, null);
     rb.keyPress(KeyEvent.VK_CONTROL);
      rb.keyPress(KeyEvent.VK_V);
     rb.keyRelease(KeyEvent.VK_TAB);
    rb.keyRelease(KeyEvent.VK_TAB);
     //press enter
     rb.keyRelease(KeyEvent.VK_ENTER);

Advertisement

Answer

You can overcome this by using the following:

baseUrl=”http://” + username + “:” + password + “@” + url;

driver.get(baseUrl + “/”);

This should bypass the window as you are authenticating upon opening the application.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement