Doesn't this interface limit us to prompting twice for input?  That is, if the caller knows it needs both USERNAME and PASSWORD (think HTTP basic auth) we have to ask the provider twice.  So the provider has to open a dialog and ask for username, close that dialog, return the value, then open another to ask for password.  Ick.

What about this interface instead:

  public abstract Map<CredentialType, Object> getCredentials(URIish uri, CredentialType... types);

Then we can ask for either one value, or multiple values, at one time.

But this still isn't completely flexible.  We can't use this interface to ask for an SSH key passphrase for example, because we cannot extend the CredentialType enumeration with a new value.

I have a different alternative idea.  I'll try uploading a replacement patch set with it for comments.