Class SystemDefaultCredentialsProvider
java.lang.Object
org.apache.hc.client5.http.impl.auth.SystemDefaultCredentialsProvider
- All Implemented Interfaces:
CredentialsProvider,CredentialsStore
@Contract(threading=SAFE)
public class SystemDefaultCredentialsProvider
extends Object
implements CredentialsStore
Implementation of
CredentialsStore backed by standard
JRE Authenticator.- Since:
- 4.3
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all credentials.getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context) Returnscredentialsfor the given authentication scope, if available.private static PasswordAuthenticationgetProxyCredentials(String protocol, AuthScope authScope) private static PasswordAuthenticationgetSystemCreds(String protocol, AuthScope authScope, Authenticator.RequestorType requestorType, HttpClientContext context) voidsetCredentials(AuthScope authScope, Credentials credentials) Sets thecredentialsfor the given authentication scope.
-
Field Details
-
internal
-
-
Constructor Details
-
SystemDefaultCredentialsProvider
public SystemDefaultCredentialsProvider()Default constructor.
-
-
Method Details
-
setCredentials
Description copied from interface:CredentialsStoreSets thecredentialsfor the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentialsin interfaceCredentialsStore- Parameters:
authScope- theauthentication scopecredentials- the authenticationcredentialsfor the given scope.- See Also:
-
getSystemCreds
private static PasswordAuthentication getSystemCreds(String protocol, AuthScope authScope, Authenticator.RequestorType requestorType, HttpClientContext context) -
getCredentials
public Credentials getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context) Description copied from interface:CredentialsProviderReturnscredentialsfor the given authentication scope, if available.- Specified by:
getCredentialsin interfaceCredentialsProvider- Parameters:
authScope- theauthentication scopecontext- thehttp context- Returns:
- the credentials
-
getProxyCredentials
-
clear
public void clear()Description copied from interface:CredentialsStoreClears all credentials.- Specified by:
clearin interfaceCredentialsStore
-