@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); }
@Private public static void setSecretManager( AbstractDelegationTokenSecretManager<RMDelegationTokenIdentifier> secretManager, InetSocketAddress serviceAddress) { localSecretManager = secretManager; localServiceAddress = serviceAddress; }
@VisibleForTesting @SuppressWarnings("rawtypes") public AbstractDelegationTokenSecretManager getDelegationTokenSecretManager() { return secretManager; }
public static void setDelegationTokenSecretManager( AbstractDelegationTokenSecretManager<?> manager) { RMAuthenticationFilter.manager = manager; }
/** * Sets an external <code>DelegationTokenSecretManager</code> instance to * manage creation and verification of Delegation Tokens. * <p/> * This is useful for use cases where secrets must be shared across multiple * services. * * @param secretManager a <code>DelegationTokenSecretManager</code> instance */ public void setExternalDelegationTokenSecretManager( AbstractDelegationTokenSecretManager secretManager) { this.secretManager.stopThreads(); this.secretManager = secretManager; managedSecretManager = false; }
/** * Sets an external <code>DelegationTokenSecretManager</code> instance to * manage creation and verification of Delegation Tokens. * <p/> * This is useful for use cases where secrets must be shared across multiple * services. * * @param secretManager a <code>DelegationTokenSecretManager</code> instance */ public void setExternalDelegationTokenSecretManager( AbstractDelegationTokenSecretManager secretManager) { tokenManager.setExternalDelegationTokenSecretManager(secretManager); }