L
L.Pietrzak
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
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