예제 #1
0
        /// <exception cref="Javax.Servlet.ServletException"/>
        public override void Init(FilterConfig filterConfig)
        {
            base.Init(filterConfig);
            AuthenticationHandler handler = GetAuthenticationHandler();
            AbstractDelegationTokenSecretManager dtSecretManager = (AbstractDelegationTokenSecretManager
                                                                    )filterConfig.GetServletContext().GetAttribute(DelegationTokenSecretManagerAttr);

            if (dtSecretManager != null && handler is DelegationTokenAuthenticationHandler)
            {
                DelegationTokenAuthenticationHandler dtHandler = (DelegationTokenAuthenticationHandler
                                                                  )GetAuthenticationHandler();
                dtHandler.SetExternalDelegationTokenSecretManager(dtSecretManager);
            }
            if (handler is PseudoAuthenticationHandler || handler is PseudoDelegationTokenAuthenticationHandler)
            {
                SetHandlerAuthMethod(SaslRpcServer.AuthMethod.Simple);
            }
            if (handler is KerberosAuthenticationHandler || handler is KerberosDelegationTokenAuthenticationHandler)
            {
                SetHandlerAuthMethod(SaslRpcServer.AuthMethod.Kerberos);
            }
            // proxyuser configuration
            Configuration conf = GetProxyuserConfiguration(filterConfig);

            ProxyUsers.RefreshSuperUserGroupsConfiguration(conf, ProxyuserPrefix);
        }
예제 #2
0
        public virtual void SetUp()
        {
            Properties conf = new Properties();

            conf[KerberosDelegationTokenAuthenticationHandler.TokenKind] = "foo";
            handler = new TestDelegationTokenAuthenticationHandlerWithMocks.MockDelegationTokenAuthenticationHandler
                          ();
            handler.InitTokenManager(conf);
        }