Class BasicCredentialsProvider
java.lang.Object
org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider
- All Implemented Interfaces:
CredentialsProvider,CredentialsStore
@Contract(threading=SAFE)
public class BasicCredentialsProvider
extends Object
implements CredentialsStore
Default implementation of
CredentialsStore.- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all credentials.getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext httpContext) Returnscredentialsfor the given authentication scope, if available.private static CredentialsmatchCredentials(Map<AuthScope, Credentials> map, AuthScope authScope) Find matchingcredentialsfor the given authentication scope.voidsetCredentials(AuthScope authScope, Credentials credentials) Sets thecredentialsfor the given authentication scope.toString()
-
Field Details
-
credMap
-
-
Constructor Details
-
BasicCredentialsProvider
public BasicCredentialsProvider()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:
-
matchCredentials
Find matchingcredentialsfor the given authentication scope.- Parameters:
map- the credentials hash mapauthScope- theauthentication scope- Returns:
- the credentials
-
getCredentials
public Credentials getCredentials(AuthScope authScope, org.apache.hc.core5.http.protocol.HttpContext httpContext) Description copied from interface:CredentialsProviderReturnscredentialsfor the given authentication scope, if available.- Specified by:
getCredentialsin interfaceCredentialsProvider- Parameters:
authScope- theauthentication scopehttpContext- thehttp context- Returns:
- the credentials
-
clear
public void clear()Description copied from interface:CredentialsStoreClears all credentials.- Specified by:
clearin interfaceCredentialsStore
-
toString
-