當前位置: 首頁>>代碼示例>>Java>>正文


Java PlainMechanismHandler類代碼示例

本文整理匯總了Java中org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler的典型用法代碼示例。如果您正苦於以下問題:Java PlainMechanismHandler類的具體用法?Java PlainMechanismHandler怎麽用?Java PlainMechanismHandler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PlainMechanismHandler類屬於org.apache.directory.server.ldap.handlers.bind.plain包,在下文中一共展示了PlainMechanismHandler類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startLdapServer

import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler; //導入依賴的package包/類
private ApacheDS startLdapServer() throws Exception {
  Preconditions.checkState(directoryService.isStarted());
  Preconditions.checkState(!ldapServer.isStarted());

  int port = AvailablePortFinder.getNextAvailable(1024);
  ldapServer.setTransports(new TcpTransport(port));
  ldapServer.setDirectoryService(directoryService);

  // Setup SASL mechanisms
  Map<String, MechanismHandler> mechanismHandlerMap = Maps.newHashMap();
  mechanismHandlerMap.put(SupportedSaslMechanisms.PLAIN, new PlainMechanismHandler());
  mechanismHandlerMap.put(SupportedSaslMechanisms.CRAM_MD5, new CramMd5MechanismHandler());
  mechanismHandlerMap.put(SupportedSaslMechanisms.DIGEST_MD5, new DigestMd5MechanismHandler());
  mechanismHandlerMap.put(SupportedSaslMechanisms.GSSAPI, new GssapiMechanismHandler());
  ldapServer.setSaslMechanismHandlers(mechanismHandlerMap);

  ldapServer.setSaslHost("localhost");
  ldapServer.setSaslRealms(Collections.singletonList(realm));
  // TODO ldapServer.setSaslPrincipal();
  // The base DN containing users that can be SASL authenticated.
  ldapServer.setSearchBaseDn(baseDn);

  ldapServer.start();

  return this;
}
 
開發者ID:SonarQubeCommunity,項目名稱:sonar-activedirectory,代碼行數:27,代碼來源:ApacheDS.java

示例2: setupSaslMechanisms

import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler; //導入依賴的package包/類
/**
 * @param server
 *            The server
 */
private void setupSaslMechanisms(LdapServer server) {
    HashMap<String, MechanismHandler> mechanismHandlerMap = new HashMap<String, MechanismHandler>();

    mechanismHandlerMap.put(SupportedSaslMechanisms.PLAIN, new PlainMechanismHandler());

    CramMd5MechanismHandler cramMd5MechanismHandler = new CramMd5MechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.CRAM_MD5, cramMd5MechanismHandler);

    DigestMd5MechanismHandler digestMd5MechanismHandler = new DigestMd5MechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.DIGEST_MD5, digestMd5MechanismHandler);

    GssapiMechanismHandler gssapiMechanismHandler = new GssapiMechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.GSSAPI, gssapiMechanismHandler);

    NtlmMechanismHandler ntlmMechanismHandler = new NtlmMechanismHandler();
    // TODO - set some sort of default NtlmProvider implementation here
    // ntlmMechanismHandler.setNtlmProvider( provider );
    // TODO - or set FQCN of some sort of default NtlmProvider implementation here
    // ntlmMechanismHandler.setNtlmProviderFqcn( "com.foo.BarNtlmProvider" );
    mechanismHandlerMap.put(SupportedSaslMechanisms.NTLM, ntlmMechanismHandler);
    mechanismHandlerMap.put(SupportedSaslMechanisms.GSS_SPNEGO, ntlmMechanismHandler);

    getLdapServer().setSaslMechanismHandlers(mechanismHandlerMap);
}
 
開發者ID:Communote,項目名稱:communote-server,代碼行數:29,代碼來源:AbstractApacheDSServer.java

示例3: setupSaslMechanisms

import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler; //導入依賴的package包/類
private void setupSaslMechanisms() {
    Map<String, MechanismHandler> mechanismHandlerMap = new HashMap<String, MechanismHandler>();

    mechanismHandlerMap.put(SupportedSaslMechanisms.PLAIN, new PlainMechanismHandler());

    CramMd5MechanismHandler cramMd5MechanismHandler = new CramMd5MechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.CRAM_MD5, cramMd5MechanismHandler);

    DigestMd5MechanismHandler digestMd5MechanismHandler = new DigestMd5MechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.DIGEST_MD5, digestMd5MechanismHandler);

    GssapiMechanismHandler gssapiMechanismHandler = new GssapiMechanismHandler();
    mechanismHandlerMap.put(SupportedSaslMechanisms.GSSAPI, gssapiMechanismHandler);

    NtlmMechanismHandler ntlmMechanismHandler = new NtlmMechanismHandler();

    mechanismHandlerMap.put(SupportedSaslMechanisms.NTLM, ntlmMechanismHandler);
    mechanismHandlerMap.put(SupportedSaslMechanisms.GSS_SPNEGO, ntlmMechanismHandler);

    this.ldapServer.setSaslMechanismHandlers(mechanismHandlerMap);
}
 
開發者ID:wso2-attic,項目名稱:carbon-identity,代碼行數:22,代碼來源:ApacheLDAPServer.java


注:本文中的org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。