I have the url which needs credentials and I am navigating to that through selenium + Java https://username:password.example.com/
However it still shows the login window but not as an alert window. Attached the screenshot. I tried the below code but it did not work
UserAndPassword UP = new UserAndPassword("username","password");
driver.switchTo().alert().authenticateUsing(UP);
