Fix ChainingCredentialsProvider

The ChainingCredentialsProvider gave up chaining to the next provider if
the first one returned no credentials items for the given URI.

Change-Id: I9539c50db35e564db9d43d8ebb71d7e9c6fdcc19
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn 2015-11-27 11:23:42 +01:00
parent ac89b47eeb
commit 5786cc3c0f
1 changed files with 8 additions and 2 deletions

View File

@ -113,9 +113,15 @@ public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem {
for (CredentialsProvider p : credentialProviders) {
if (p.supports(items)) {
p.get(uri, items);
if (isAnyNull(items))
if (!p.get(uri, items)) {
if (p.isInteractive()) {
return false; // user cancelled the request
}
continue;
}
if (isAnyNull(items)) {
continue;
}
return true;
}
}