ChainingCredentialsProvider
, NetRCCredentialsProvider
, UsernamePasswordCredentialsProvider
public abstract class CredentialsProvider extends Object
CredentialItem.Username
and CredentialItem.Password
items.
More sophisticated implementors may implement additional types, such as
CredentialItem.StringType
.
CredentialItems are usually presented in bulk, allowing implementors to
combine them into a single UI widget and streamline the authentication
process for an end-user.UsernamePasswordCredentialsProvider
Constructor | Description |
---|---|
CredentialsProvider() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
get(URIish uri,
List<CredentialItem> items) |
Ask for the credential items to be populated.
|
abstract boolean |
get(URIish uri,
CredentialItem... items) |
Ask for the credential items to be populated.
|
static CredentialsProvider |
getDefault() |
|
abstract boolean |
isInteractive() |
Check if the provider is interactive with the end-user.
|
void |
reset(URIish uri) |
Reset the credentials provider for the given URI
|
static void |
setDefault(CredentialsProvider p) |
Set the default credentials provider.
|
abstract boolean |
supports(CredentialItem... items) |
Check if the provider can supply the necessary
CredentialItem s. |
public static CredentialsProvider getDefault()
public static void setDefault(CredentialsProvider p)
p
- the new default provider, may be null to select no default.public abstract boolean isInteractive()
true
if the provider is interactive with the end-user.public abstract boolean supports(CredentialItem... items)
CredentialItem
s.items
- the items the application requires to complete authentication.true
if this CredentialsProvider
supports all of
the items supplied.public abstract boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem
uri
- the URI of the remote resource that needs authentication.items
- the items the application requires to complete authentication.true
if the request was successful and values were
supplied; false
if the user canceled the request and did
not supply all requested values.UnsupportedCredentialItem
- if one of the items supplied is not supported.public boolean get(URIish uri, List<CredentialItem> items) throws UnsupportedCredentialItem
uri
- the URI of the remote resource that needs authentication.items
- the items the application requires to complete authentication.true
if the request was successful and values were
supplied; false
if the user canceled the request and did
not supply all requested values.UnsupportedCredentialItem
- if one of the items supplied is not supported.public void reset(URIish uri)
uri
- Copyright © 2018. All rights reserved.