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 java.lang.Object implements CredentialsStore
Implementation ofCredentialsStore
backed by standard JREAuthenticator
.- Since:
- 4.3
-
-
Field Summary
Fields Modifier and Type Field Description private BasicCredentialsProvider
internal
-
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, org.apache.hc.core5.http.protocol.HttpContext context)
Returnscredentials
for the given authentication scope, if available.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, HttpClientContext context)
void
setCredentials(AuthScope authScope, Credentials credentials)
Sets thecredentials
for the given authentication scope.
-
-
-
Field Detail
-
internal
private final BasicCredentialsProvider internal
-
-
Method Detail
-
setCredentials
public void setCredentials(AuthScope authScope, Credentials credentials)
Description copied from interface:CredentialsStore
Sets thecredentials
for the given authentication scope. Any previous credentials for the given scope will be overwritten.- Specified by:
setCredentials
in interfaceCredentialsStore
- Parameters:
authScope
- theauthentication scope
credentials
- the authenticationcredentials
for the given scope.- See Also:
CredentialsProvider.getCredentials(AuthScope, org.apache.hc.core5.http.protocol.HttpContext)
-
getSystemCreds
private static java.net.PasswordAuthentication getSystemCreds(java.lang.String protocol, AuthScope authScope, java.net.Authenticator.RequestorType requestorType, HttpClientContext context)
-
getCredentials
public Credentials getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext context)
Description copied from interface:CredentialsProvider
Returnscredentials
for the given authentication scope, if available.- Specified by:
getCredentials
in interfaceCredentialsProvider
- Parameters:
authScope
- theauthentication scope
context
- thehttp context
- Returns:
- the credentials
-
getProxyCredentials
private static java.net.PasswordAuthentication getProxyCredentials(java.lang.String protocol, AuthScope authScope)
-
clear
public void clear()
Description copied from interface:CredentialsStore
Clears all credentials.- Specified by:
clear
in interfaceCredentialsStore
-
-