Hi all,
I have a question about why the userAllowedSave() method of the JavaHL
PromptUserPassword3 interface works in different way in compare to its
description? This is really a bug or may be undocumented feature?
The description says that:
/**
* @return Whether the caller allowed caching of credentials the
* last time {@link #prompt(String, String, boolean)} was called.
* Applications wanting to emulate the behavior of
* <code>--no-auth-cache</code> will probably always return
* <code>false</code>.
*/
public boolean userAllowedSave();
So, I implemented the PromptUserPassword3 interface and my implementation
always returns "false", i.e. we don't want to save credentials in any case.
There is an implementation of the PromtUserPassword3 callback:
protected class RepositoryInfoPrompt implements PromptUserPassword3 {
protected ICredentialsPrompt prompt;
public RepositoryInfoPrompt(ICredentialsPrompt prompt) {
this.prompt = prompt;
}
public boolean prompt(String realm, String username) {
return this.prompt.prompt(null, realm);
}
public boolean prompt(String realm, String username, boolean maySave) {
return this.prompt.prompt(null, realm);
}
public int askTrustSSLServer(String info, boolean allowPermanently) {
return this.prompt.askTrustSSLServer(null, info, allowPermanently);
}
public String getUsername() {
return this.prompt.getUsername();
}
public String getPassword() {
return this.prompt.getPassword();
}
public boolean askYesNo(String realm, String question, boolean
yesIsDefault) {
return false;
}
public String askQuestion(String realm, String question, boolean
showAnswer, boolean maySave) {
if (question.indexOf("certificate filename") != -1) {
......................................
}
return null;
}
public String askQuestion(String realm, String question, boolean
showAnswer) {
return null;
}
public boolean userAllowedSave() {
return false;
}
}
I checked that the userAllowedSave() method is really called but credentials
information are always cached.
The confuration in which I tested this option are:
Win32 (WinXP SP2 + latest sequirity patches), Native JavaHL implementation
version SVN:1.4.2 (r22196) jni:0.9.0
Should I post this issue to the tracker?
Best regards,
Alexander Gurov
Subversive Team
Received on Fri Dec 15 19:04:55 2006