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
You are missing @ symbol after user name and password. You can try like below,
https://username:password@test.discoverykidsplay.com/