commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yannick PIERSON" <piers...@gmail.com>
Subject VFS NTLM authentification
Date Thu, 12 Jun 2008 17:57:08 GMT
Hi,

I would like to make a NTLM authentification but I get this error:

Credentials cannot be used for NTLM authentication:
org.apache.commons.httpclient.UsernamePasswordCredentials
org.apache.commons.httpclient.auth.InvalidCredentialsException: Credentials
cannot be used for NTLM authentication:
org.apache.commons.httpclient.UsernamePasswordCredential

with this simplified code:
StaticUserAuthenticator auth = new StaticUserAuthenticator("domain", "user",
"password");
FileSystemOptions opts = new FileSystemOptions();
DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts,
auth);
FileObject fo = VFS.getManager().resolveFile("
http://host/Webfolder/my_file.zip", opts);

I would like to use this authentification in order to get a file on a web
folder and then get a FileObject.

I'am able to get it with this code but I would like to get the file across a
VfsJfileChooser:
HttpClient oClient = new HttpClient();
NTCredentials oCredentials = new NTCredentials("user", "password", "host",
"domain");
oClient.getState().setCredentials("domain", "host", oCredentials);
String sOrganizerUrl = "http://" + "host" + "/" +
"Webfolder/my_file.zip";
GetMethod oGetMethod = new GetMethod(sOrganizerUrl);
oGetMethod.setDoAuthentication(true);
oClient.executeMethod(oGetMethod);

I think it's possible to combine jCIFS with commons-vfs but I don't find
how: Authentifications classes cannot be cast.

Thanks,

Regards,

Yannick

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message