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 Object
implements CredentialsProvider
Implementation of
CredentialsProvider
backed by standard
JRE Authenticator
.- Since:
- 4.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all credentials.getCredentials
(AuthScope authscope) Get thecredentials
for the given authentication scope.private static PasswordAuthentication
getProxyCredentials
(String protocol, AuthScope authscope) private static PasswordAuthentication
getSystemCreds
(String protocol, AuthScope authscope, Authenticator.RequestorType requestorType) void
setCredentials
(AuthScope authscope, Credentials credentials) Sets thecredentials
for the given authentication scope.private static String
translateScheme
(String key)
-
Field Details
-
SCHEME_MAP
-
internal
-
-
Constructor Details
-
SystemDefaultCredentialsProvider
public SystemDefaultCredentialsProvider()Default constructor.
-
-
Method Details
-
translateScheme
-
setCredentials
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:
-
getSystemCreds
private static PasswordAuthentication getSystemCreds(String protocol, AuthScope authscope, Authenticator.RequestorType requestorType) -
getCredentials
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:
-
getProxyCredentials
-
clear
public void clear()Description copied from interface:CredentialsProvider
Clears all credentials.- Specified by:
clear
in interfaceCredentialsProvider
-