当前位置: 首页>>代码示例>>Java>>正文


Java AuthSchemeFactory类代码示例

本文整理汇总了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);
}
 
开发者ID:adamcin,项目名称:httpsig-java,代码行数:23,代码来源:Http4Util.java

示例2: getPreemptiveAuthSchemeFactory

import org.apache.http.auth.AuthSchemeFactory; //导入依赖的package包/类
@Override
public AuthSchemeFactory getPreemptiveAuthSchemeFactory()
{
	// anonymous authentication doesn't support preemptive authentication
	return null;
}
 
开发者ID:dmfs,项目名称:android-authenticator-framework,代码行数:7,代码来源:AnonymousAuthenticationProvider.java

示例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();
 
开发者ID:dmfs,项目名称:android-authenticator-framework,代码行数:7,代码来源:HttpClientAuthenticationHandler.java


注:本文中的org.apache.http.auth.AuthSchemeFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。