本文整理汇总了Java中org.apache.directory.server.kerberos.KerberosConfig类的典型用法代码示例。如果您正苦于以下问题:Java KerberosConfig类的具体用法?Java KerberosConfig怎么用?Java KerberosConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
KerberosConfig类属于org.apache.directory.server.kerberos包,在下文中一共展示了KerberosConfig类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initKdcServer
import org.apache.directory.server.kerberos.KerberosConfig; //导入依赖的package包/类
private void initKdcServer() throws KerberosException {
KerberosConfig kdcConfig = new KerberosConfig();
kdcConfig.setSearchBaseDn(USERS_DN);
kdcConfig.setServicePrincipal(getPrincipal("krbtgt/" + realm));
kdcConfig.setPrimaryRealm(realm);
kdcConfig.setMaximumTicketLifetime(TimeUnit.DAYS.toMillis(1));
kdcConfig.setMaximumRenewableLifetime(TimeUnit.DAYS.toMillis(1));
kdcConfig.setForwardableAllowed(true);
kdcConfig.setPostdatedAllowed(true);
kdcConfig.setProxiableAllowed(true);
kdcConfig.setRenewableAllowed(true);
kdcConfig.setEmptyAddressesAllowed(true);
kdcConfig.setPaEncTimestampRequired(false);
kdcServer = new KdcServer(kdcConfig);
try {
host = InetAddress.getLocalHost().getCanonicalHostName();
} catch (UnknownHostException e) {
LOGGER.warn("Failed to get canonical host name. Using default: " + host);
}
TcpTransport defaultTransport = new TcpTransport(host, port);
kdcServer.addTransports(defaultTransport);
kdcServer.setDirectoryService(directoryService);
addUserEntry("krbtgt/" + realm, "pass");
}
示例2: NoReplayKdcServer
import org.apache.directory.server.kerberos.KerberosConfig; //导入依赖的package包/类
NoReplayKdcServer(KerberosConfig kdcConfig) {
super(kdcConfig);
}