@Contract(threading=SAFE) public class SystemDefaultCredentialsProvider extends java.lang.Object implements CredentialsProvider
CredentialsProvider
backed by standard
JRE Authenticator
.Modifier and Type | Field and Description |
---|---|
private BasicCredentialsProvider |
internal |
private static java.util.Map<java.lang.String,java.lang.String> |
SCHEME_MAP |
Constructor and Description |
---|
SystemDefaultCredentialsProvider()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears all credentials.
|
Credentials |
getCredentials(AuthScope authscope)
Get the
credentials for the given authentication scope. |
private static java.net.PasswordAuthentication |
getProxyCredentials(java.lang.String protocol,
AuthScope authscope) |
private static java.net.PasswordAuthentication |
getSystemCreds(java.lang.String protocol,
AuthScope authscope,
java.net.Authenticator.RequestorType requestorType) |
void |
setCredentials(AuthScope authscope,
Credentials credentials)
Sets the
credentials for the given authentication
scope. |
private static java.lang.String |
translateScheme(java.lang.String key) |
private static final java.util.Map<java.lang.String,java.lang.String> SCHEME_MAP
private final BasicCredentialsProvider internal
public SystemDefaultCredentialsProvider()
private static java.lang.String translateScheme(java.lang.String key)
public void setCredentials(AuthScope authscope, Credentials credentials)
CredentialsProvider
credentials
for the given authentication
scope. Any previous credentials for the given scope will be overwritten.setCredentials
in interface CredentialsProvider
authscope
- the authentication scope
credentials
- the authentication credentials
for the given scope.CredentialsProvider.getCredentials(AuthScope)
private static java.net.PasswordAuthentication getSystemCreds(java.lang.String protocol, AuthScope authscope, java.net.Authenticator.RequestorType requestorType)
public Credentials getCredentials(AuthScope authscope)
CredentialsProvider
credentials
for the given authentication scope.getCredentials
in interface CredentialsProvider
authscope
- the authentication scope
CredentialsProvider.setCredentials(AuthScope, Credentials)
private static java.net.PasswordAuthentication getProxyCredentials(java.lang.String protocol, AuthScope authscope)
public void clear()
CredentialsProvider
clear
in interface CredentialsProvider