Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2006

Tip: Looking for answers? Try searching our database.

NTLM Authentication

Thread view: 
L.Pietrzak@gmail.com - 12 Jul 2006 13:09 GMT
Hi
I need to login to a server that uses NTLM authentication scheme.
I figured out sth like that :
      Authenticator.setDefault(new MyAuthenticator(login,password));
      URL url = new URL(httpPage);
      URLConnection connection = url.openConnection();
      PasswordAuthentication pa =
Authenticator.requestPasswordAuthentication(InetAddress
                                    .getByName(connection.getURL().getHost()),
                                    connection.getURL().getPort(), connection
                                            .getURL().getProtocol(), null,
                                    "NTLM");

MyAuthenticator is a class that extends Authenticator, and of course
implements properly (rather sure) getPasswordAuthentication() method.

The problem is that I always get Unauthorized access :/. I'm quite sure
that I'm providing good login and password.
The thing I think is causing the problem is "NTLM" argument that I'm
providing in requestPasswordAuthentication. API says, that there should
be a schema there, but I don't know what the schema for the NTLM is.
Can anyone help me?

Btw. If I put there "NTLM1" for example, I get the same response
(Unauthorized accesss).
Regards
Rogan Dawes - 12 Jul 2006 13:45 GMT
> Hi
> I need to login to a server that uses NTLM authentication scheme.
[quoted text clipped - 22 lines]
> (Unauthorized accesss).
> Regards

I think you are barking up the wrong tree with these classes.

I suggest you take a look at jCIFS (google it), which provides a working
NTLM authentication mechanism.

Regards,

Rogan
Desperate - 12 Jul 2006 14:16 GMT
> I think you are barking up the wrong tree with these classes.
>
> I suggest you take a look at jCIFS (google it), which provides a working
> NTLM authentication mechanism.

Unfortunately (AFAIK) jCIFS does not support NTLM v2, and I require
this feature.
Rogan Dawes - 12 Jul 2006 15:11 GMT
>> I think you are barking up the wrong tree with these classes.
>>
[quoted text clipped - 3 lines]
> Unfortunately (AFAIK) jCIFS does not support NTLM v2, and I require
> this feature.

Have you tried it?

Rogan
Desperate - 12 Jul 2006 15:18 GMT
> > Unfortunately (AFAIK) jCIFS does not support NTLM v2, and I require
> > this feature.
>
> Have you tried it?

I read here : http://oaklandsoftware.com/papers/ntlm.html that it
doesn't support it and didn't have much time to question it.
Are you saying that jCIFS supports NTLM v2 ?
Regards
LukaszP - 12 Jul 2006 18:58 GMT
Sorry to bother, but I really need the answer :/
LukaszP - 12 Jul 2006 18:58 GMT
> Are you saying that jCIFS supports NTLM v2 ?
> Regards

Rogan?
Rogan Dawes - 12 Jul 2006 20:25 GMT
>>> Unfortunately (AFAIK) jCIFS does not support NTLM v2, and I require
>>> this feature.
[quoted text clipped - 5 lines]
> Are you saying that jCIFS supports NTLM v2 ?
> Regards

No, I"m not. Indeed, it appears that it doesn't support NTLM v2.

However, I have seen mention of patches to support NTLM v2 in the Apache
HttpClient, by doing a bit of googling. They were not accepted due to
licensing concerns, but you may be able to integrate them yourself . . . .

And, if you are on a Windows Platform, it seems that NTLM auth IS
natively supported in Java, from v1.5 onwards. Apparently you need to
set some system properties to enable it. You might have been on the
right track after all  . . . .

Regards,

Rogan
LukaszP - 12 Jul 2006 20:37 GMT
> And, if you are on a Windows Platform, it seems that NTLM auth IS natively
> supported in Java, from v1.5 onwards. Apparently you need to set some
> system properties to enable it. You might have been on the right track
> after all  . . . .

I've done some googling myself, but didn't come up with any patches for the
commons.httpclient.There is a solution created by oakland software, but is
not free.
I've read on the page I mentioned earlier that the authentication can be
done using java, but no one said that it does support ntlm v2. My recent
experiences show, that it rather doesn't :/. I can't find any (!) example on
the web.
Thx for help


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.