Package org.apache.http.impl.client
Class SystemDefaultCredentialsProvider
- java.lang.Object
-
- org.apache.http.impl.client.SystemDefaultCredentialsProvider
-
- All Implemented Interfaces:
CredentialsProvider
@Contract(threading=SAFE) public class SystemDefaultCredentialsProvider extends java.lang.Object implements CredentialsProvider
Implementation ofCredentialsProvider
backed by standard JREAuthenticator
.- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description private BasicCredentialsProvider
internal
private static java.util.Map<java.lang.String,java.lang.String>
SCHEME_MAP
-
Constructor Summary
Constructors Constructor Description SystemDefaultCredentialsProvider()
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Clears all credentials.Credentials
getCredentials(AuthScope authscope)
Get thecredentials
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 thecredentials
for the given authentication scope.private static java.lang.String
translateScheme(java.lang.String key)
-
-
-
Field Detail
-
SCHEME_MAP
private static final java.util.Map<java.lang.String,java.lang.String> SCHEME_MAP
-
internal
private final BasicCredentialsProvider internal
-
-
Method Detail
-
translateScheme
private static java.lang.String translateScheme(java.lang.String key)
-
setCredentials
public void setCredentials(AuthScope authscope, Credentials credentials)
Description copied from interface:CredentialsProvider
Sets thecredentials
for the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentials
in interfaceCredentialsProvider
- Parameters:
authscope
- theauthentication scope
credentials
- the authenticationcredentials
for the given scope.- See Also:
CredentialsProvider.getCredentials(AuthScope)
-
getSystemCreds
private static java.net.PasswordAuthentication getSystemCreds(java.lang.String protocol, AuthScope authscope, java.net.Authenticator.RequestorType requestorType)
-
getCredentials
public Credentials getCredentials(AuthScope authscope)
Description copied from interface:CredentialsProvider
Get thecredentials
for the given authentication scope.- Specified by:
getCredentials
in interfaceCredentialsProvider
- Parameters:
authscope
- theauthentication scope
- Returns:
- the credentials
- See Also:
CredentialsProvider.setCredentials(AuthScope, Credentials)
-
getProxyCredentials
private static java.net.PasswordAuthentication getProxyCredentials(java.lang.String protocol, AuthScope authscope)
-
clear
public void clear()
Description copied from interface:CredentialsProvider
Clears all credentials.- Specified by:
clear
in interfaceCredentialsProvider
-
-