本文整理汇总了Java中org.apache.http.auth.AuthSchemeFactory类的典型用法代码示例。如果您正苦于以下问题:Java AuthSchemeFactory类的具体用法?Java AuthSchemeFactory怎么用?Java AuthSchemeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AuthSchemeFactory类属于org.apache.http.auth包,在下文中一共展示了AuthSchemeFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableAuth
import org.apache.http.auth.AuthSchemeFactory; //导入依赖的package包/类
public static void enableAuth(final AbstractHttpClient client, final Keychain keychain, final KeyId keyId) {
if (client == null) {
throw new NullPointerException("client");
}
if (keychain == null) {
throw new NullPointerException("keychain");
}
client.getAuthSchemes().register(Constants.SCHEME, new AuthSchemeFactory() {
public AuthScheme newInstance(HttpParams params) {
return new Http4SignatureAuthScheme();
}
});
Signer signer = new Signer(keychain, keyId);
client.getCredentialsProvider().setCredentials(AuthScope.ANY, new SignerCredentials(signer));
client.getParams().setParameter(AuthPNames.TARGET_AUTH_PREF,
Arrays.asList(Constants.SCHEME));
HttpClientParams.setAuthenticating(client.getParams(), true);
}
示例2: getPreemptiveAuthSchemeFactory
import org.apache.http.auth.AuthSchemeFactory; //导入依赖的package包/类
@Override
public AuthSchemeFactory getPreemptiveAuthSchemeFactory()
{
// anonymous authentication doesn't support preemptive authentication
return null;
}
示例3: getPreemptiveAuthSchemeFactory
import org.apache.http.auth.AuthSchemeFactory; //导入依赖的package包/类
@Override
public AuthSchemeFactory getPreemptiveAuthSchemeFactory()
{
return BASIC_SCHEME_FACTORY;
}
开发者ID:dmfs,项目名称:android-authenticator-framework,代码行数:6,代码来源:BasicHttpClientAuthenticationHandler.java
示例4: getPreemptiveAuthSchemeFactory
import org.apache.http.auth.AuthSchemeFactory; //导入依赖的package包/类
/**
* Get an AuthSchemeFactory for {@link AuthScheme}s that can be used to authenticate preemptively.
*
* @return An {@link AuthSchemeFactory} or <code>null</code> if this scheme doesn't support preemptive authentication.
*/
public AuthSchemeFactory getPreemptiveAuthSchemeFactory();