Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

NTLM authentication

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Actually I don't know whether I've chosen the right category, but I think this one suited the best for my question.
Can anyone tell me whether Java > 1.4 can support NTLM v2 authentication ? I've read here http://oaklandsoftware.com/papers/ntlm.html that it does, but I can't get it to work.
My code looks like this :
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic