Example usage for org.apache.hadoop.security.authentication.server AuthenticationFilter AUTH_TYPE

List of usage examples for org.apache.hadoop.security.authentication.server AuthenticationFilter AUTH_TYPE

Introduction

In this page you can find the example usage for org.apache.hadoop.security.authentication.server AuthenticationFilter AUTH_TYPE.

Prototype

String AUTH_TYPE

To view the source code for org.apache.hadoop.security.authentication.server AuthenticationFilter AUTH_TYPE.

Click Source Link

Document

Constant for the property that specifies the authentication handler to use.

Usage

From source file:io.druid.security.kerberos.KerberosAuthenticator.java

License:Apache License

@Override
public Map<String, String> getInitParameters() {
    Map<String, String> params = new HashMap<String, String>();
    try {//  w  w w.ja  v  a  2  s  .c  om
        params.put("kerberos.principal", SecurityUtil.getServerPrincipal(serverPrincipal, node.getHost()));
        params.put("kerberos.keytab", serverKeytab);
        params.put(AuthenticationFilter.AUTH_TYPE, DruidKerberosAuthenticationHandler.class.getName());
        params.put("kerberos.name.rules", authToLocal);
        if (cookieSignatureSecret != null) {
            params.put("signature.secret", cookieSignatureSecret);
        }
    } catch (IOException e) {
        Throwables.propagate(e);
    }
    return params;
}

From source file:io.druid.security.kerberos.SpnegoFilterHolder.java

License:Apache License

@Override
public Map<String, String> getInitParameters() {
    Map<String, String> params = new HashMap<String, String>();
    try {//from ww  w  . j a  v a 2  s .c o  m
        params.put("kerberos.principal",
                SecurityUtil.getServerPrincipal(config.getPrincipal(), node.getHost()));
        params.put("kerberos.keytab", config.getKeytab());
        params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");
        params.put("kerberos.name.rules", config.getAuthToLocal());
        if (config.getCookieSignatureSecret() != null) {
            params.put("signature.secret", config.getCookieSignatureSecret());
        }
    } catch (IOException e) {
        Throwables.propagate(e);
    }
    return params;
}

From source file:org.apache.druid.security.kerberos.KerberosAuthenticator.java

License:Apache License

@Override
public Map<String, String> getInitParameters() {
    Map<String, String> params = new HashMap<String, String>();
    params.put("kerberos.principal", serverPrincipal);
    params.put("kerberos.keytab", serverKeytab);
    params.put(AuthenticationFilter.AUTH_TYPE, DruidKerberosAuthenticationHandler.class.getName());
    params.put("kerberos.name.rules", authToLocal);
    if (cookieSignatureSecret != null) {
        params.put("signature.secret", cookieSignatureSecret);
    }//from  w w  w . j ava  2 s .  c om
    return params;
}

From source file:org.apache.hive.http.HttpServer.java

License:Apache License

/**
 * Secure the web server with kerberos (AuthenticationFilter).
 */// ww  w  .  jav  a  2 s  .  c om
void setupSpnegoFilter(Builder b) throws IOException {
    Map<String, String> params = new HashMap<String, String>();
    params.put("kerberos.principal", SecurityUtil.getServerPrincipal(b.spnegoPrincipal, b.host));
    params.put("kerberos.keytab", b.spnegoKeytab);
    params.put(AuthenticationFilter.AUTH_TYPE, "kerberos");
    FilterHolder holder = new FilterHolder();
    holder.setClassName(AuthenticationFilter.class.getName());
    holder.setInitParameters(params);

    ServletHandler handler = webAppContext.getServletHandler();
    handler.addFilterWithMapping(holder, "/*", FilterMapping.ALL);
}

From source file:org.apache.solr.security.HttpParamDelegationTokenPlugin.java

License:Apache License

@Override
public void init(Map<String, Object> pluginConfig) {
    try {//w ww  .  j a  v a  2 s.  c o  m
        final FilterConfig initConf = getInitFilterConfig(pluginConfig, true);

        FilterConfig conf = new FilterConfig() {
            @Override
            public ServletContext getServletContext() {
                return initConf.getServletContext();
            }

            @Override
            public Enumeration<String> getInitParameterNames() {
                return initConf.getInitParameterNames();
            }

            @Override
            public String getInitParameter(String param) {
                if (AuthenticationFilter.AUTH_TYPE.equals(param)) {
                    return HttpParamDelegationTokenAuthenticationHandler.class.getName();
                }
                return initConf.getInitParameter(param);
            }

            @Override
            public String getFilterName() {
                return "HttpParamFilter";
            }
        };
        Filter kerberosFilter = new HttpParamToRequestFilter();
        kerberosFilter.init(conf);
        setKerberosFilter(kerberosFilter);
    } catch (ServletException e) {
        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
                "Error initializing kerberos authentication plugin: " + e);
    }
}