Search in sources :

Example 11 with AuthorizeCallback

use of javax.security.sasl.AuthorizeCallback in project kafka by apache.

the class KerberosClientCallbackHandler method handle.

@Override
public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
    for (Callback callback : callbacks) {
        if (callback instanceof NameCallback) {
            NameCallback nc = (NameCallback) callback;
            nc.setName(nc.getDefaultName());
        } else if (callback instanceof PasswordCallback) {
            String errorMessage = "Could not login: the client is being asked for a password, but the Kafka" + " client code does not currently support obtaining a password from the user.";
            errorMessage += " Make sure -Djava.security.auth.login.config property passed to JVM and" + " the client is configured to use a ticket cache (using" + " the JAAS configuration setting 'useTicketCache=true)'. Make sure you are using" + " FQDN of the Kafka broker you are trying to connect to.";
            throw new UnsupportedCallbackException(callback, errorMessage);
        } else if (callback instanceof RealmCallback) {
            RealmCallback rc = (RealmCallback) callback;
            rc.setText(rc.getDefaultText());
        } else if (callback instanceof AuthorizeCallback) {
            AuthorizeCallback ac = (AuthorizeCallback) callback;
            String authId = ac.getAuthenticationID();
            String authzId = ac.getAuthorizationID();
            ac.setAuthorized(authId.equals(authzId));
            if (ac.isAuthorized())
                ac.setAuthorizedID(authzId);
        } else {
            throw new UnsupportedCallbackException(callback, "Unrecognized SASL ClientCallback");
        }
    }
}
Also used : RealmCallback(javax.security.sasl.RealmCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) NameCallback(javax.security.auth.callback.NameCallback) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) Callback(javax.security.auth.callback.Callback) NameCallback(javax.security.auth.callback.NameCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) UnsupportedCallbackException(javax.security.auth.callback.UnsupportedCallbackException) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) RealmCallback(javax.security.sasl.RealmCallback)

Example 12 with AuthorizeCallback

use of javax.security.sasl.AuthorizeCallback in project alluxio by Alluxio.

the class PlainSaslServer method evaluateResponse.

@Override
@Nullable
public byte[] evaluateResponse(byte[] response) throws SaslException {
    Preconditions.checkState(!mCompleted, "PLAIN authentication has completed");
    Preconditions.checkArgument(response != null, "Received null response");
    try {
        // parse the response
        // message = [authorizationId] UTF8NUL authenticationId UTF8NUL passwd'
        // authorizationId may be empty,then the authorizationId = authenticationId
        String payload;
        try {
            payload = new String(response, "UTF-8");
        } catch (Exception e) {
            throw new IllegalArgumentException("Received corrupt response", e);
        }
        String[] parts = payload.split("\u0000", 3);
        // validate response
        if (parts.length != 3) {
            throw new IllegalArgumentException("Invalid message format, parts must contain 3 items");
        }
        String authorizationId = parts[0];
        String authenticationId = parts[1];
        String passwd = parts[2];
        Preconditions.checkState(authenticationId != null && !authenticationId.isEmpty(), "No authentication identity provided");
        Preconditions.checkState(passwd != null && !passwd.isEmpty(), "No password provided");
        if (authorizationId == null || authorizationId.isEmpty()) {
            authorizationId = authenticationId;
        }
        NameCallback nameCallback = new NameCallback("User");
        nameCallback.setName(authenticationId);
        PasswordCallback passwordCallback = new PasswordCallback("Password", false);
        passwordCallback.setPassword(passwd.toCharArray());
        AuthorizeCallback authCallback = new AuthorizeCallback(authenticationId, authorizationId);
        Callback[] cbList = { nameCallback, passwordCallback, authCallback };
        mHandler.handle(cbList);
        if (!authCallback.isAuthorized()) {
            throw new SaslException("AuthorizeCallback authorized failure");
        }
        mAuthorizationId = authCallback.getAuthorizedID();
    } catch (Exception e) {
        throw new SaslException("Plain authentication failed: " + e.getMessage(), e);
    }
    mCompleted = true;
    return null;
}
Also used : NameCallback(javax.security.auth.callback.NameCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) NameCallback(javax.security.auth.callback.NameCallback) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) Callback(javax.security.auth.callback.Callback) PasswordCallback(javax.security.auth.callback.PasswordCallback) SaslException(javax.security.sasl.SaslException) SaslException(javax.security.sasl.SaslException) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) Nullable(javax.annotation.Nullable)

Example 13 with AuthorizeCallback

use of javax.security.sasl.AuthorizeCallback in project alluxio by Alluxio.

the class PlainSaslServerCallbackHandlerTest method authenticateNameMatch.

/**
 * Tests that the authentication callbacks matches.
 */
@Test
public void authenticateNameMatch() throws Exception {
    String authenticateId = "alluxio-1";
    NameCallback ncb = new NameCallback(" authentication id: ");
    ncb.setName(authenticateId);
    PasswordCallback pcb = new PasswordCallback(" password: ", false);
    pcb.setPassword("password".toCharArray());
    Callback[] callbacks = new Callback[] { ncb, pcb, new AuthorizeCallback(authenticateId, authenticateId) };
    mPlainServerCBHandler.handle(callbacks);
}
Also used : NameCallback(javax.security.auth.callback.NameCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) NameCallback(javax.security.auth.callback.NameCallback) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) Callback(javax.security.auth.callback.Callback) PasswordCallback(javax.security.auth.callback.PasswordCallback) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) Test(org.junit.Test)

Example 14 with AuthorizeCallback

use of javax.security.sasl.AuthorizeCallback in project hbase by apache.

the class SaslPlainServer method evaluateResponse.

@Override
public byte[] evaluateResponse(byte[] response) throws SaslException {
    if (completed) {
        throw new IllegalStateException("PLAIN authentication has completed");
    }
    if (response == null) {
        throw new IllegalArgumentException("Received null response");
    }
    try {
        String payload;
        try {
            payload = new String(response, StandardCharsets.UTF_8);
        } catch (Exception e) {
            throw new IllegalArgumentException("Received corrupt response", e);
        }
        // [ authz, authn, password ]
        String[] parts = payload.split("\u0000", 3);
        if (parts.length != 3) {
            throw new IllegalArgumentException("Received corrupt response");
        }
        if (parts[0].isEmpty()) {
            // authz = authn
            parts[0] = parts[1];
        }
        NameCallback nc = new NameCallback("SASL PLAIN");
        nc.setName(parts[1]);
        PasswordCallback pc = new PasswordCallback("SASL PLAIN", false);
        pc.setPassword(parts[2].toCharArray());
        AuthorizeCallback ac = new AuthorizeCallback(parts[1], parts[0]);
        cbh.handle(new Callback[] { nc, pc, ac });
        if (ac.isAuthorized()) {
            authz = ac.getAuthorizedID();
        }
    } catch (Exception e) {
        throw new SaslException("PLAIN auth failed: " + e.toString(), e);
    } finally {
        completed = true;
    }
    return null;
}
Also used : NameCallback(javax.security.auth.callback.NameCallback) PasswordCallback(javax.security.auth.callback.PasswordCallback) SaslException(javax.security.sasl.SaslException) SaslException(javax.security.sasl.SaslException) AuthorizeCallback(javax.security.sasl.AuthorizeCallback)

Example 15 with AuthorizeCallback

use of javax.security.sasl.AuthorizeCallback in project hbase by apache.

the class ThriftServer method setupServer.

/**
 * Setting up the thrift TServer
 */
protected void setupServer() throws Exception {
    // Construct correct ProtocolFactory
    TProtocolFactory protocolFactory = getProtocolFactory();
    ImplType implType = ImplType.getServerImpl(conf);
    TProcessor processorToUse = processor;
    // Construct correct TransportFactory
    TTransportFactory transportFactory;
    if (conf.getBoolean(FRAMED_CONF_KEY, FRAMED_CONF_DEFAULT) || implType.isAlwaysFramed) {
        if (qop != null) {
            throw new RuntimeException("Thrift server authentication" + " doesn't work with framed transport yet");
        }
        transportFactory = new TFramedTransport.Factory(conf.getInt(MAX_FRAME_SIZE_CONF_KEY, MAX_FRAME_SIZE_CONF_DEFAULT) * 1024 * 1024);
        LOG.debug("Using framed transport");
    } else if (qop == null) {
        transportFactory = new TTransportFactory();
    } else {
        // Extract the name from the principal
        String thriftKerberosPrincipal = conf.get(THRIFT_KERBEROS_PRINCIPAL_KEY);
        if (thriftKerberosPrincipal == null) {
            throw new IllegalArgumentException(THRIFT_KERBEROS_PRINCIPAL_KEY + " cannot be null");
        }
        String name = SecurityUtil.getUserFromPrincipal(thriftKerberosPrincipal);
        Map<String, String> saslProperties = SaslUtil.initSaslProperties(qop.name());
        TSaslServerTransport.Factory saslFactory = new TSaslServerTransport.Factory();
        saslFactory.addServerDefinition("GSSAPI", name, host, saslProperties, new SaslRpcServer.SaslGssCallbackHandler() {

            @Override
            public void handle(Callback[] callbacks) throws UnsupportedCallbackException {
                AuthorizeCallback ac = null;
                for (Callback callback : callbacks) {
                    if (callback instanceof AuthorizeCallback) {
                        ac = (AuthorizeCallback) callback;
                    } else {
                        throw new UnsupportedCallbackException(callback, "Unrecognized SASL GSSAPI Callback");
                    }
                }
                if (ac != null) {
                    String authid = ac.getAuthenticationID();
                    String authzid = ac.getAuthorizationID();
                    if (!authid.equals(authzid)) {
                        ac.setAuthorized(false);
                    } else {
                        ac.setAuthorized(true);
                        String userName = SecurityUtil.getUserFromPrincipal(authzid);
                        LOG.info("Effective user: {}", userName);
                        ac.setAuthorizedID(userName);
                    }
                }
            }
        });
        transportFactory = saslFactory;
        // Create a processor wrapper, to get the caller
        processorToUse = (inProt, outProt) -> {
            TSaslServerTransport saslServerTransport = (TSaslServerTransport) inProt.getTransport();
            SaslServer saslServer = saslServerTransport.getSaslServer();
            String principal = saslServer.getAuthorizationID();
            hbaseServiceHandler.setEffectiveUser(principal);
            processor.process(inProt, outProt);
        };
    }
    if (conf.get(BIND_CONF_KEY) != null && !implType.canSpecifyBindIP) {
        LOG.error("Server types {} don't support IP address binding at the moment. See " + "https://issues.apache.org/jira/browse/HBASE-2155 for details.", Joiner.on(", ").join(ImplType.serversThatCannotSpecifyBindIP()));
        throw new RuntimeException("-" + BIND_CONF_KEY + " not supported with " + implType);
    }
    InetSocketAddress inetSocketAddress = new InetSocketAddress(getBindAddress(conf), listenPort);
    if (implType == ImplType.HS_HA || implType == ImplType.NONBLOCKING || implType == ImplType.THREADED_SELECTOR) {
        TNonblockingServerTransport serverTransport = new TNonblockingServerSocket(inetSocketAddress);
        if (implType == ImplType.NONBLOCKING) {
            tserver = getTNonBlockingServer(serverTransport, protocolFactory, processorToUse, transportFactory, inetSocketAddress);
        } else if (implType == ImplType.HS_HA) {
            tserver = getTHsHaServer(serverTransport, protocolFactory, processorToUse, transportFactory, inetSocketAddress);
        } else {
            // THREADED_SELECTOR
            tserver = getTThreadedSelectorServer(serverTransport, protocolFactory, processorToUse, transportFactory, inetSocketAddress);
        }
        LOG.info("starting HBase {} server on {}", implType.simpleClassName(), Integer.toString(listenPort));
    } else if (implType == ImplType.THREAD_POOL) {
        this.tserver = getTThreadPoolServer(protocolFactory, processorToUse, transportFactory, inetSocketAddress);
    } else {
        throw new AssertionError("Unsupported Thrift server implementation: " + implType.simpleClassName());
    }
    // A sanity check that we instantiated the right type of server.
    if (tserver.getClass() != implType.serverClass) {
        throw new AssertionError("Expected to create Thrift server class " + implType.serverClass.getName() + " but got " + tserver.getClass().getName());
    }
}
Also used : THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SERVER_SOCKET_READ_TIMEOUT_KEY) UserProvider(org.apache.hadoop.hbase.security.UserProvider) Server(org.apache.hbase.thirdparty.org.eclipse.jetty.server.Server) TThreadedSelectorServer(org.apache.thrift.server.TThreadedSelectorServer) ThreadFactoryBuilder(org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder) UnsupportedCallbackException(javax.security.auth.callback.UnsupportedCallbackException) SslConnectionFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.server.SslConnectionFactory) TServer(org.apache.thrift.server.TServer) TBinaryProtocol(org.apache.thrift.protocol.TBinaryProtocol) THRIFT_SUPPORT_PROXYUSER_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SUPPORT_PROXYUSER_KEY) InetAddress(java.net.InetAddress) THRIFT_INFO_SERVER_BINDING_ADDRESS(org.apache.hadoop.hbase.thrift.Constants.THRIFT_INFO_SERVER_BINDING_ADDRESS) HttpConfiguration(org.apache.hbase.thirdparty.org.eclipse.jetty.server.HttpConfiguration) THRIFT_KEYTAB_FILE_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_KEYTAB_FILE_KEY) ProxyUsers(org.apache.hadoop.security.authorize.ProxyUsers) DefaultParser(org.apache.hbase.thirdparty.org.apache.commons.cli.DefaultParser) MIN_WORKERS_OPTION(org.apache.hadoop.hbase.thrift.Constants.MIN_WORKERS_OPTION) Map(java.util.Map) Configuration(org.apache.hadoop.conf.Configuration) ParseFilter(org.apache.hadoop.hbase.filter.ParseFilter) BACKLOG_CONF_DEAFULT(org.apache.hadoop.hbase.thrift.Constants.BACKLOG_CONF_DEAFULT) THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SERVER_SOCKET_READ_TIMEOUT_DEFAULT) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) Joiner(org.apache.hbase.thirdparty.com.google.common.base.Joiner) HTTP_MAX_THREADS_KEY(org.apache.hadoop.hbase.thrift.Constants.HTTP_MAX_THREADS_KEY) HTTP_MIN_THREADS_KEY(org.apache.hadoop.hbase.thrift.Constants.HTTP_MIN_THREADS_KEY) HttpServerUtil(org.apache.hadoop.hbase.http.HttpServerUtil) ExitCodeException(org.apache.hadoop.util.Shell.ExitCodeException) HttpConnectionFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.server.HttpConnectionFactory) TNonblockingServerTransport(org.apache.thrift.transport.TNonblockingServerTransport) THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_INFO_SERVER_BINDING_ADDRESS_DEFAULT) BlockingQueue(java.util.concurrent.BlockingQueue) READ_TIMEOUT_OPTION(org.apache.hadoop.hbase.thrift.Constants.READ_TIMEOUT_OPTION) Strings(org.apache.hadoop.hbase.util.Strings) MAX_FRAME_SIZE_CONF_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.MAX_FRAME_SIZE_CONF_DEFAULT) JvmPauseMonitor(org.apache.hadoop.hbase.util.JvmPauseMonitor) QueuedThreadPool(org.apache.hbase.thirdparty.org.eclipse.jetty.util.thread.QueuedThreadPool) COMPACT_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.COMPACT_CONF_KEY) Callback(javax.security.auth.callback.Callback) TProcessor(org.apache.thrift.TProcessor) MAX_FRAME_SIZE_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.MAX_FRAME_SIZE_CONF_KEY) TServlet(org.apache.thrift.server.TServlet) Options(org.apache.hbase.thirdparty.org.apache.commons.cli.Options) DEFAULT_HTTP_MAX_HEADER_SIZE(org.apache.hadoop.hbase.thrift.Constants.DEFAULT_HTTP_MAX_HEADER_SIZE) ServletContextHandler(org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletContextHandler) COMPACT_CONF_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.COMPACT_CONF_DEFAULT) USE_HTTP_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.USE_HTTP_CONF_KEY) HTTP_MAX_THREADS_KEY_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.HTTP_MAX_THREADS_KEY_DEFAULT) FRAMED_CONF_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.FRAMED_CONF_DEFAULT) SaslUtil(org.apache.hadoop.hbase.security.SaslUtil) TSaslServerTransport(org.apache.thrift.transport.TSaslServerTransport) UserGroupInformation(org.apache.hadoop.security.UserGroupInformation) THRIFT_SSL_KEYSTORE_PASSWORD_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_KEYSTORE_PASSWORD_KEY) InfoServer(org.apache.hadoop.hbase.http.InfoServer) PORT_OPTION(org.apache.hadoop.hbase.thrift.Constants.PORT_OPTION) FRAMED_OPTION(org.apache.hadoop.hbase.thrift.Constants.FRAMED_OPTION) ServletHolder(org.apache.hbase.thirdparty.org.eclipse.jetty.servlet.ServletHolder) KEEP_ALIVE_SEC_OPTION(org.apache.hadoop.hbase.thrift.Constants.KEEP_ALIVE_SEC_OPTION) IOException(java.io.IOException) HelpFormatter(org.apache.hbase.thirdparty.org.apache.commons.cli.HelpFormatter) HttpVersion(org.apache.hbase.thirdparty.org.eclipse.jetty.http.HttpVersion) THRIFT_SPNEGO_KEYTAB_FILE_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SPNEGO_KEYTAB_FILE_KEY) ServerConnector(org.apache.hbase.thirdparty.org.eclipse.jetty.server.ServerConnector) TProtocolFactory(org.apache.thrift.protocol.TProtocolFactory) UnknownHostException(java.net.UnknownHostException) SELECTOR_NUM_OPTION(org.apache.hadoop.hbase.thrift.Constants.SELECTOR_NUM_OPTION) CommandLineParser(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLineParser) HTTP_MIN_THREADS_KEY_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.HTTP_MIN_THREADS_KEY_DEFAULT) THRIFT_SSL_KEYSTORE_TYPE_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_KEYSTORE_TYPE_DEFAULT) CommandLine(org.apache.hbase.thirdparty.org.apache.commons.cli.CommandLine) THRIFT_SSL_EXCLUDE_PROTOCOLS_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_EXCLUDE_PROTOCOLS_KEY) INFOPORT_OPTION(org.apache.hadoop.hbase.thrift.Constants.INFOPORT_OPTION) THsHaServer(org.apache.thrift.server.THsHaServer) THRIFT_INFO_SERVER_PORT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_INFO_SERVER_PORT) LoggerFactory(org.slf4j.LoggerFactory) PORT_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.PORT_CONF_KEY) Splitter(org.apache.hbase.thirdparty.com.google.common.base.Splitter) COMPACT_OPTION(org.apache.hadoop.hbase.thrift.Constants.COMPACT_OPTION) THRIFT_HTTP_ALLOW_OPTIONS_METHOD_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_HTTP_ALLOW_OPTIONS_METHOD_DEFAULT) THRIFT_SSL_INCLUDE_PROTOCOLS_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_INCLUDE_PROTOCOLS_KEY) SslContextFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.util.ssl.SslContextFactory) FRAMED_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.FRAMED_CONF_KEY) Configured(org.apache.hadoop.conf.Configured) Hbase(org.apache.hadoop.hbase.thrift.generated.Hbase) TFramedTransport(org.apache.thrift.transport.layered.TFramedTransport) THRIFT_SSL_KEYSTORE_KEYPASSWORD_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_KEYSTORE_KEYPASSWORD_KEY) THRIFT_FILTERS(org.apache.hadoop.hbase.thrift.Constants.THRIFT_FILTERS) TNonblockingServer(org.apache.thrift.server.TNonblockingServer) DEFAULT_BIND_ADDR(org.apache.hadoop.hbase.thrift.Constants.DEFAULT_BIND_ADDR) HBaseInterfaceAudience(org.apache.hadoop.hbase.HBaseInterfaceAudience) PrivilegedAction(java.security.PrivilegedAction) InetSocketAddress(java.net.InetSocketAddress) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue) Tool(org.apache.hadoop.util.Tool) THRIFT_SSL_KEYSTORE_STORE_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_KEYSTORE_STORE_KEY) TServerTransport(org.apache.thrift.transport.TServerTransport) DEFAULT_LISTEN_PORT(org.apache.hadoop.hbase.thrift.Constants.DEFAULT_LISTEN_PORT) List(java.util.List) MAX_WORKERS_OPTION(org.apache.hadoop.hbase.thrift.Constants.MAX_WORKERS_OPTION) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) HBaseConfiguration(org.apache.hadoop.hbase.HBaseConfiguration) EnvironmentEdgeManager(org.apache.hadoop.hbase.util.EnvironmentEdgeManager) MAX_QUEUE_SIZE_OPTION(org.apache.hadoop.hbase.thrift.Constants.MAX_QUEUE_SIZE_OPTION) THRIFT_SSL_KEYSTORE_TYPE_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_KEYSTORE_TYPE_KEY) TTransportFactory(org.apache.thrift.transport.TTransportFactory) DNS(org.apache.hadoop.hbase.util.DNS) THRIFT_KERBEROS_PRINCIPAL_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_KERBEROS_PRINCIPAL_KEY) THRIFT_DNS_NAMESERVER_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_DNS_NAMESERVER_KEY) THRIFT_SPNEGO_PRINCIPAL_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SPNEGO_PRINCIPAL_KEY) THRIFT_SSL_INCLUDE_CIPHER_SUITES_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_INCLUDE_CIPHER_SUITES_KEY) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) THRIFT_INFO_SERVER_PORT_DEFAULT(org.apache.hadoop.hbase.thrift.Constants.THRIFT_INFO_SERVER_PORT_DEFAULT) ArrayUtils(org.apache.commons.lang3.ArrayUtils) SaslRpcServer(org.apache.hadoop.security.SaslRpcServer) TNonblockingServerSocket(org.apache.thrift.transport.TNonblockingServerSocket) THRIFT_SSL_ENABLED_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_ENABLED_KEY) SecurityUtil(org.apache.hadoop.hbase.security.SecurityUtil) THRIFT_QOP_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_QOP_KEY) THRIFT_HTTP_ALLOW_OPTIONS_METHOD(org.apache.hadoop.hbase.thrift.Constants.THRIFT_HTTP_ALLOW_OPTIONS_METHOD) ExecutorService(java.util.concurrent.ExecutorService) THRIFT_SSL_EXCLUDE_CIPHER_SUITES_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SSL_EXCLUDE_CIPHER_SUITES_KEY) Logger(org.slf4j.Logger) HBaseMarkers(org.apache.hadoop.hbase.log.HBaseMarkers) VersionInfo(org.apache.hadoop.hbase.util.VersionInfo) THRIFT_DNS_INTERFACE_KEY(org.apache.hadoop.hbase.thrift.Constants.THRIFT_DNS_INTERFACE_KEY) ToolRunner(org.apache.hadoop.util.ToolRunner) THRIFT_SELECTOR_NUM(org.apache.hadoop.hbase.thrift.Constants.THRIFT_SELECTOR_NUM) TimeUnit(java.util.concurrent.TimeUnit) TServerSocket(org.apache.thrift.transport.TServerSocket) SecureRequestCustomizer(org.apache.hbase.thirdparty.org.eclipse.jetty.server.SecureRequestCustomizer) InterfaceAudience(org.apache.yetus.audience.InterfaceAudience) BIND_OPTION(org.apache.hadoop.hbase.thrift.Constants.BIND_OPTION) BACKLOG_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.BACKLOG_CONF_KEY) BIND_CONF_KEY(org.apache.hadoop.hbase.thrift.Constants.BIND_CONF_KEY) SaslServer(javax.security.sasl.SaslServer) TProtocolFactory(org.apache.thrift.protocol.TProtocolFactory) TNonblockingServerTransport(org.apache.thrift.transport.TNonblockingServerTransport) SaslServer(javax.security.sasl.SaslServer) InetSocketAddress(java.net.InetSocketAddress) SslConnectionFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.server.SslConnectionFactory) HttpConnectionFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.server.HttpConnectionFactory) TProtocolFactory(org.apache.thrift.protocol.TProtocolFactory) LoggerFactory(org.slf4j.LoggerFactory) SslContextFactory(org.apache.hbase.thirdparty.org.eclipse.jetty.util.ssl.SslContextFactory) TTransportFactory(org.apache.thrift.transport.TTransportFactory) TTransportFactory(org.apache.thrift.transport.TTransportFactory) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) TSaslServerTransport(org.apache.thrift.transport.TSaslServerTransport) Callback(javax.security.auth.callback.Callback) AuthorizeCallback(javax.security.sasl.AuthorizeCallback) TProcessor(org.apache.thrift.TProcessor) TFramedTransport(org.apache.thrift.transport.layered.TFramedTransport) TNonblockingServerSocket(org.apache.thrift.transport.TNonblockingServerSocket) UnsupportedCallbackException(javax.security.auth.callback.UnsupportedCallbackException) Map(java.util.Map)

Aggregations

AuthorizeCallback (javax.security.sasl.AuthorizeCallback)36 Callback (javax.security.auth.callback.Callback)29 NameCallback (javax.security.auth.callback.NameCallback)28 PasswordCallback (javax.security.auth.callback.PasswordCallback)26 UnsupportedCallbackException (javax.security.auth.callback.UnsupportedCallbackException)26 RealmCallback (javax.security.sasl.RealmCallback)16 IOException (java.io.IOException)12 SaslException (javax.security.sasl.SaslException)9 HashMap (java.util.HashMap)5 Map (java.util.Map)5 SaslServer (javax.security.sasl.SaslServer)3 TProtocolFactory (org.apache.thrift.protocol.TProtocolFactory)3 TSaslServerTransport (org.apache.thrift.transport.TSaslServerTransport)3 TTransportFactory (org.apache.thrift.transport.TTransportFactory)3 InetAddress (java.net.InetAddress)2 InetSocketAddress (java.net.InetSocketAddress)2 ArrayDeque (java.util.ArrayDeque)2 List (java.util.List)2 ExecutorService (java.util.concurrent.ExecutorService)2 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)2