Package org.eclipse.jgit.transport
Class ChainingCredentialsProvider
java.lang.Object
org.eclipse.jgit.transport.CredentialsProvider
org.eclipse.jgit.transport.ChainingCredentialsProvider
A credentials provider chaining multiple credentials providers
- Since:
- 3.5
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionChainingCredentialsProvider
(CredentialsProvider... providers) Create a new chaining credential provider. -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(URIish uri, CredentialItem... items) Ask for the credential items to be populated.boolean
Check if the provider is interactive with the end-user.boolean
supports
(CredentialItem... items) Check if the provider can supply the necessaryCredentialItem
s.Methods inherited from class org.eclipse.jgit.transport.CredentialsProvider
get, getDefault, isAnyNull, reset, setDefault
-
Field Details
-
credentialProviders
-
-
Constructor Details
-
ChainingCredentialsProvider
Create a new chaining credential provider. This provider tries to retrieve credentials from the chained credential providers in the order they are given here. If multiple providers support the requested items and have non-null credentials the first of them will be used.- Parameters:
providers
- credential providers asked for credentials in the order given here
-
-
Method Details
-
isInteractive
public boolean isInteractive()Check if the provider is interactive with the end-user. An interactive provider may try to open a dialog box, or prompt for input on the terminal, and will wait for a user response. A non-interactive provider will either populate CredentialItems, or fail.- Specified by:
isInteractive
in classCredentialsProvider
- Returns:
true
if the provider is interactive with the end-user.
-
supports
Check if the provider can supply the necessaryCredentialItem
s.- Specified by:
supports
in classCredentialsProvider
- Parameters:
items
- the items the application requires to complete authentication.- Returns:
true
if thisCredentialsProvider
supports all of the items supplied.
-
get
Ask for the credential items to be populated.Populates the credential items with the credentials provided by the first credential provider in the list which populates them with non-null values
- Specified by:
get
in classCredentialsProvider
- Parameters:
uri
- the URI of the remote resource that needs authentication.items
- the items the application requires to complete authentication.- Returns:
true
if the request was successful and values were supplied;false
if the user canceled the request and did not supply all requested values.- Throws:
UnsupportedCredentialItem
- if one of the items supplied is not supported.- See Also:
-