[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Confusing PromptUserPassword3.userAllowedSave() method behavior

From: Alexander Gurov <alexander.gurov_at_polarion.org>
Date: 2006-12-15 18:55:58 CET

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

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.