本文整理汇总了Java中org.springframework.ldap.core.support.LdapContextSource.setAuthenticationStrategy方法的典型用法代码示例。如果您正苦于以下问题:Java LdapContextSource.setAuthenticationStrategy方法的具体用法?Java LdapContextSource.setAuthenticationStrategy怎么用?Java LdapContextSource.setAuthenticationStrategy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.ldap.core.support.LdapContextSource
的用法示例。
在下文中一共展示了LdapContextSource.setAuthenticationStrategy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTls
import org.springframework.ldap.core.support.LdapContextSource; //导入方法依赖的package包/类
void setTls(LdapContextSource ldapContextSource) {
// set tls
logger.debug("Ldap TLS enabled.");
DefaultTlsDirContextAuthenticationStrategy tls = new DefaultTlsDirContextAuthenticationStrategy();
tls.setHostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
});
tls.setSslSocketFactory(new DummySSLSocketFactory());
ldapContextSource.setAuthenticationStrategy(tls);
}
示例2: setAdditionalContextSourceProperties
import org.springframework.ldap.core.support.LdapContextSource; //导入方法依赖的package包/类
protected void setAdditionalContextSourceProperties(LdapContextSource ctx, final String dnsName) {
DigestMd5DirContextAuthenticationStrategy authenticationStrategy = new DigestMd5DirContextAuthenticationStrategy();
// authenticationStrategy.setHostnameVerifier(new HostnameVerifier() {
// public boolean verify(String hostname, SSLSession session) {
// return hostname.equals(dnsName);
// }
// });
ctx.setAuthenticationStrategy(authenticationStrategy);
ctx.setPooled(false);
}
开发者ID:spring-projects,项目名称:spring-ldap,代码行数:13,代码来源:DigestMd5ContextSourceEc2InstanceLaunchingFactoryBean.java
示例3: setAdditionalContextSourceProperties
import org.springframework.ldap.core.support.LdapContextSource; //导入方法依赖的package包/类
protected void setAdditionalContextSourceProperties(LdapContextSource ctx, final String dnsName) {
DefaultTlsDirContextAuthenticationStrategy authenticationStrategy = new DefaultTlsDirContextAuthenticationStrategy();
authenticationStrategy.setHostnameVerifier(new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return hostname.equals(dnsName);
}
});
ctx.setAuthenticationStrategy(authenticationStrategy);
ctx.setPooled(false);
}
开发者ID:spring-projects,项目名称:spring-ldap,代码行数:13,代码来源:TlsContextSourceEc2InstanceLaunchingFactoryBean.java