Search in sources :

Example 1 with AbstractDelegationTokenSecretManager

use of org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager in project hadoop by apache.

the class DelegationTokenAuthenticationFilter method init.

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    super.init(filterConfig);
    AuthenticationHandler handler = getAuthenticationHandler();
    AbstractDelegationTokenSecretManager dtSecretManager = (AbstractDelegationTokenSecretManager) filterConfig.getServletContext().getAttribute(DELEGATION_TOKEN_SECRET_MANAGER_ATTR);
    if (dtSecretManager != null && handler instanceof DelegationTokenAuthenticationHandler) {
        DelegationTokenAuthenticationHandler dtHandler = (DelegationTokenAuthenticationHandler) getAuthenticationHandler();
        dtHandler.setExternalDelegationTokenSecretManager(dtSecretManager);
    }
    if (handler instanceof PseudoAuthenticationHandler || handler instanceof PseudoDelegationTokenAuthenticationHandler) {
        setHandlerAuthMethod(SaslRpcServer.AuthMethod.SIMPLE);
    }
    if (handler instanceof KerberosAuthenticationHandler || handler instanceof KerberosDelegationTokenAuthenticationHandler) {
        setHandlerAuthMethod(SaslRpcServer.AuthMethod.KERBEROS);
    }
    // proxyuser configuration
    Configuration conf = getProxyuserConfiguration(filterConfig);
    ProxyUsers.refreshSuperUserGroupsConfiguration(conf, PROXYUSER_PREFIX);
}
Also used : KerberosAuthenticationHandler(org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler) Configuration(org.apache.hadoop.conf.Configuration) KerberosAuthenticationHandler(org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler) PseudoAuthenticationHandler(org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler) MultiSchemeAuthenticationHandler(org.apache.hadoop.security.authentication.server.MultiSchemeAuthenticationHandler) AuthenticationHandler(org.apache.hadoop.security.authentication.server.AuthenticationHandler) AbstractDelegationTokenSecretManager(org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager) PseudoAuthenticationHandler(org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)1 AuthenticationHandler (org.apache.hadoop.security.authentication.server.AuthenticationHandler)1 KerberosAuthenticationHandler (org.apache.hadoop.security.authentication.server.KerberosAuthenticationHandler)1 MultiSchemeAuthenticationHandler (org.apache.hadoop.security.authentication.server.MultiSchemeAuthenticationHandler)1 PseudoAuthenticationHandler (org.apache.hadoop.security.authentication.server.PseudoAuthenticationHandler)1 AbstractDelegationTokenSecretManager (org.apache.hadoop.security.token.delegation.AbstractDelegationTokenSecretManager)1