Search in sources :

Example 1 with Krb5HttpClientBuilder

use of org.apache.solr.client.solrj.impl.Krb5HttpClientBuilder in project lucene-solr by apache.

the class HadoopAuthPlugin method init.

@Override
public void init(Map<String, Object> pluginConfig) {
    try {
        String delegationTokenEnabled = (String) pluginConfig.getOrDefault(DELEGATION_TOKEN_ENABLED_PROPERTY, "false");
        authFilter = (Boolean.parseBoolean(delegationTokenEnabled)) ? new HadoopAuthFilter() : new AuthenticationFilter();
        // Initialize kerberos before initializing curator instance.
        boolean initKerberosZk = Boolean.parseBoolean((String) pluginConfig.getOrDefault(INIT_KERBEROS_ZK, "false"));
        if (initKerberosZk) {
            (new Krb5HttpClientBuilder()).getBuilder();
        }
        FilterConfig conf = getInitFilterConfig(pluginConfig);
        authFilter.init(conf);
    } catch (ServletException e) {
        throw new SolrException(ErrorCode.SERVER_ERROR, "Error initializing " + getClass().getName() + ": " + e);
    }
}
Also used : ServletException(javax.servlet.ServletException) AuthenticationFilter(org.apache.hadoop.security.authentication.server.AuthenticationFilter) FilterConfig(javax.servlet.FilterConfig) SolrException(org.apache.solr.common.SolrException) Krb5HttpClientBuilder(org.apache.solr.client.solrj.impl.Krb5HttpClientBuilder)

Aggregations

FilterConfig (javax.servlet.FilterConfig)1 ServletException (javax.servlet.ServletException)1 AuthenticationFilter (org.apache.hadoop.security.authentication.server.AuthenticationFilter)1 Krb5HttpClientBuilder (org.apache.solr.client.solrj.impl.Krb5HttpClientBuilder)1 SolrException (org.apache.solr.common.SolrException)1