hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ji, Yuan" <Yuan...@celcorp.com>
Subject RE: NTLM help -- how to get domain?
Date Wed, 26 Jan 2005 19:05:52 GMT
Oleg,

Could you tell me how to programmatically get current userid/password and domain name using
Java? Our Java program will only run in Windows 2000/XP, so it's OK to use platform dependent
code. 

Thanks.

Yuan

-----Original Message-----
From: Oleg Kalnichevski [mailto:olegk@apache.org] 
Sent: January 20, 2005 12:45 PM
To: HttpClient Project
Subject: RE: NTLM help -- how to get domain?

Dave,

The user _should_ explicitly specify her domain as a part of Windows authentication process,
because it may not necessarily be that of the host. One _could_ dynamically retrieve the logon
credentials using Win32 API or Active Directory API, assuming this is the set of credentials
user wants to be authenticating with, but that would imply the use of platform dependent code
in your application

Oleg

On Thu, 2005-01-20 at 14:27 -0500, Dave Seidel wrote:
> So what I'm really trying to figure out is what value to use for the 
> domain name when constructing an instance of NTCredentials.  I'd been 
> using the client's hostname.  This works on our LAN, which has no 
> domain controller and just uses a workgroup.  But I'm guessing that in 
> an environment with a domain controller, I need to use the real domain name.  Is that
correct?
> And if so, is %USERDOMAIN% a valid way to get that name?
> 
> - Dave
> 
> -----Original Message-----
> From: Oleg Kalnichevski [mailto:olegk@apache.org]
> Sent: Thursday, January 20, 2005 2:10 PM
> To: HttpClient Project
> Subject: Re: NTLM help -- how to get domain?
> 
> 
> > I guess a machine can be in more than one domain. 
> 
> Not really. A host can be member of one domain only, but the domain in 
> question may trust (and be trusted by) other domains, in which case 
> the domain controller delegates authentication to a domain controller 
> of the trusted domain
> 
> Sorry for being pedantic. I used to be an MCSD in pre .NET times ;-)
> 
> Evil Comrade Oleg
> 
> 
> > You must provide the
> > domain you are authenticating against (which is not necessarily the 
> > same as the machine is in). I see the domain name as a name space, 
> > in which a set of credentials is valid. I don't know of a way to 
> > retrieve the NT domains of a machine. Maybe ask MS.
> > 
> > Ortwin Gl├╝ck
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-dev-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: 
> httpclient-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message