Search in sources :

Example 1 with CramMd5MechanismHandler

use of org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler in project jackrabbit-oak by apache.

the class AbstractServer method setupSaslMechanisms.

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();
    // 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);
    ldapServer.setSaslMechanismHandlers(mechanismHandlerMap);
}
Also used : PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) NtlmMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler) HashMap(java.util.HashMap) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) NtlmMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.MechanismHandler) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler)

Example 2 with CramMd5MechanismHandler

use of org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler in project sonarqube by SonarSource.

the class ApacheDS method startLdapServer.

private ApacheDS startLdapServer(int port) throws Exception {
    ldapServer.setTransports(new TcpTransport(port));
    ldapServer.setDirectoryService(directoryService);
    // Setup SASL mechanisms
    Map<String, MechanismHandler> mechanismHandlerMap = new HashMap<>();
    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;
}
Also used : PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) HashMap(java.util.HashMap) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.MechanismHandler) TcpTransport(org.apache.directory.server.protocol.shared.transport.TcpTransport) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler)

Example 3 with CramMd5MechanismHandler

use of org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler in project sonarqube by SonarSource.

the class ApacheDS method startLdapServer.

private ApacheDS startLdapServer(int port) throws Exception {
    ldapServer.setTransports(new TcpTransport(port));
    ldapServer.setDirectoryService(directoryService);
    // Setup SASL mechanisms
    Map<String, MechanismHandler> mechanismHandlerMap = new HashMap<>();
    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;
}
Also used : PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) HashMap(java.util.HashMap) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.MechanismHandler) TcpTransport(org.apache.directory.server.protocol.shared.transport.TcpTransport) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler)

Example 4 with CramMd5MechanismHandler

use of org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler in project keycloak by keycloak.

the class KerberosEmbeddedServer method createLdapServer.

@Override
protected LdapServer createLdapServer() {
    LdapServer ldapServer = super.createLdapServer();
    ldapServer.setSaslHost(this.bindHost);
    ldapServer.setSaslPrincipal(this.ldapSaslPrincipal);
    ldapServer.setSaslRealms(new ArrayList<String>());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.PLAIN, new PlainMechanismHandler());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.CRAM_MD5, new CramMd5MechanismHandler());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.DIGEST_MD5, new DigestMd5MechanismHandler());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.GSSAPI, new GssapiMechanismHandler());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.NTLM, new NtlmMechanismHandler());
    ldapServer.addSaslMechanismHandler(SupportedSaslMechanisms.GSS_SPNEGO, new NtlmMechanismHandler());
    return ldapServer;
}
Also used : PlainMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler) GssapiMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler) NtlmMechanismHandler(org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler) LdapServer(org.apache.directory.server.ldap.LdapServer) CramMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler) DigestMd5MechanismHandler(org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler)

Aggregations

CramMd5MechanismHandler (org.apache.directory.server.ldap.handlers.sasl.cramMD5.CramMd5MechanismHandler)4 DigestMd5MechanismHandler (org.apache.directory.server.ldap.handlers.sasl.digestMD5.DigestMd5MechanismHandler)4 GssapiMechanismHandler (org.apache.directory.server.ldap.handlers.sasl.gssapi.GssapiMechanismHandler)4 PlainMechanismHandler (org.apache.directory.server.ldap.handlers.sasl.plain.PlainMechanismHandler)4 HashMap (java.util.HashMap)3 MechanismHandler (org.apache.directory.server.ldap.handlers.sasl.MechanismHandler)3 NtlmMechanismHandler (org.apache.directory.server.ldap.handlers.sasl.ntlm.NtlmMechanismHandler)2 TcpTransport (org.apache.directory.server.protocol.shared.transport.TcpTransport)2 LdapServer (org.apache.directory.server.ldap.LdapServer)1