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


Java AuthSchemes.NTLM属性代码示例

本文整理汇总了Java中org.apache.http.client.config.AuthSchemes.NTLM属性的典型用法代码示例。如果您正苦于以下问题:Java AuthSchemes.NTLM属性的具体用法?Java AuthSchemes.NTLM怎么用?Java AuthSchemes.NTLM使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.http.client.config.AuthSchemes的用法示例。


在下文中一共展示了AuthSchemes.NTLM属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toApacheAuthenticationScheme

/**
 * Convert the customer-facing authentication method into an apache-specific authentication method.
 */
private String toApacheAuthenticationScheme(ProxyAuthenticationMethod authenticationMethod) {
    if (authenticationMethod == null) {
        throw new IllegalStateException("The configured proxy authentication methods must not be null.");
    }

    switch (authenticationMethod) {
        case NTLM: return AuthSchemes.NTLM;
        case BASIC: return AuthSchemes.BASIC;
        case DIGEST: return AuthSchemes.DIGEST;
        case SPNEGO: return AuthSchemes.SPNEGO;
        case KERBEROS: return AuthSchemes.KERBEROS;
        default: throw new IllegalStateException("Unknown authentication scheme: " + authenticationMethod);
    }
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:17,代码来源:ApacheHttpRequestFactory.java

示例2: getCredentials

@Override
public Credentials getCredentials(AuthScope authscope)
{
	Credentials retCredentials = null;
	String host = authscope.getHost();
	int port = authscope.getPort();
	if (host != AuthScope.ANY_HOST && port != AuthScope.ANY_PORT)
	{
		String scheme = authscope.getScheme().toUpperCase();
		switch (scheme)
		{
			case "BASIC":
			case "DIGEST":
				retCredentials = credentials;
				break;
			case AuthSchemes.NTLM:
				retCredentials = ntCredentials;
				break;
			default:
				break;
		}
	}

	if (retCredentials == null)
	{
		retCredentials = super.getCredentials(authscope);
	}
	return retCredentials;
}
 
开发者ID:Esri,项目名称:geoevent-datastore-proxy,代码行数:29,代码来源:HttpClientCredentialsProvider.java

示例3: getAuthenticationScheme

private String getAuthenticationScheme() {
	if (getConfiguration().getWinRmAuthenticationScheme() == null) {
		return AuthSchemes.NTLM;
	}
	if (AdLdapConfiguration.WINDOWS_AUTHENTICATION_SCHEME_BASIC.equals(getConfiguration().getWinRmAuthenticationScheme())) {
		return AuthSchemes.BASIC;
	}
	if (AdLdapConfiguration.WINDOWS_AUTHENTICATION_SCHEME_NTLM.equals(getConfiguration().getWinRmAuthenticationScheme())) {
		return AuthSchemes.NTLM;
	}
	if (AdLdapConfiguration.WINDOWS_AUTHENTICATION_SCHEME_CREDSSP.equals(getConfiguration().getWinRmAuthenticationScheme())) {
		return AuthSchemes.CREDSSP;
	}
	throw new ConfigurationException("Unknown authentication scheme: "+getConfiguration().getWinRmAuthenticationScheme());
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:15,代码来源:AdLdapConnector.java

示例4: create

@Override
public AuthScheme create(final HttpContext context) {
    return new WindowsNegotiateScheme(AuthSchemes.NTLM, servicePrincipalName);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:4,代码来源:WindowsNTLMSchemeFactory.java


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