How to provide domain,username and password value in URLConnection?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Velayoudam_Kuberan
Posted On:   Sunday, November 9, 2003 02:05 AM

My requirement is simple. I need to implement an automated log monitor [ALM]. The logs, nothing but a set of text files, are located in a remote NT Web server. I normally view the logs in IE(browser). Once I enter the remote log-server's address, it prompts me for 3 information, username, pwd and domain. Once I provide these information, I am able to access the site. Since this process is quite mundane, a requirement for an automated log monitor surfaced. All 'ALM' needs to do is log into the remote server, read the text file parse it for some pre-defined set of contents. Now I am stuck in connecting to the web-server part. I went through URLConnection, URL, URI and other java.ne   More>>

My requirement is simple.
I need to implement an automated log monitor [ALM].


The logs, nothing but a set of text files, are located in a remote NT Web server.
I normally view the logs in IE(browser). Once I enter the remote log-server's address, it prompts me for 3 information, username, pwd and domain. Once I provide these information, I am able to access the site.


Since this process is quite mundane, a requirement for an automated log monitor surfaced. All 'ALM' needs to do is log into the remote server, read the text file parse it for some pre-defined set of contents.


Now I am stuck in connecting to the web-server part.
I went through URLConnection, URL, URI and other java.net classes. I am not able to find a api/class where I can specify the domain information.


Even after I used URLConnection.setDefaultAllowUserInteraction(true) , I get a prompt with only username and password. I am not able to provide the domain information.
Although, the prompt shows a realm information, I cannot modify that information.


Could anyone let me know how to provide the domain information in the code.

   <<Less

Re: How to provide domain,username and password value in URLConnection?

Posted By:   Velayoudam_Kuberan  
Posted On:   Sunday, November 9, 2003 02:33 AM

I figured the solution for this myself.
The username needs to be prefixed with the domain name followed by a backward slash.


for eg.,
if domain is "abcd"
username is "efgh"
password is "ijkl"
Then, when the java prompt pops up for username and password, the username field should contain: abcdefgh

About | Sitemap | Contact