You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Alexander Kitaev <al...@tmate.org> on 2005/09/01 20:06:15 UTC

NTLM authentication - how to get domain and host.

Hello All,

I would like to support NTLM authentication scheme in my library when httpclient is used. As I understood I have to return instance of NTCredentials class in my CredentialsProvider implementation. 

My question is whether there is way to get "host" and "domain" values without interaction with the user, i.e. are there any environment variables or system properties (assuming Windows OS) that could contain reasonable defaults for those properties?

Thanks!

Alexander Kitaev,
TMate Software,
http://tmatesoft.com/


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


Re: NTLM authentication - how to get domain and host.

Posted by Bindul Bhowmik <bi...@gmail.com>.
Hi Alexander,

You could try gettting the value from the USERDOMAIN system property. But if 
a user has logged on locally, or if the host against which you are trying to 
authenticate is on a different domain than what the user is logging into, 
your authentication might fail. This will work in Windows only, and will not 
work for non-NT versions (Windows 98, ME, etc.)

Regards,
Bindul

On 9/1/05, Alexander Kitaev <al...@tmate.org> wrote:
> 
> Hello All,
> 
> I would like to support NTLM authentication scheme in my library when 
> httpclient is used. As I understood I have to return instance of 
> NTCredentials class in my CredentialsProvider implementation.
> 
> My question is whether there is way to get "host" and "domain" values 
> without interaction with the user, i.e. are there any environment 
> variables or system properties (assuming Windows OS) that could contain 
> reasonable defaults for those properties?
> 
> Thanks!
> 
> Alexander Kitaev,
> TMate Software,
> http://tmatesoft.com/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>