Exemplo n.º 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);
        }
Exemplo n.º 2
0
 /// <exception cref="Javax.Servlet.ServletException"/>
 protected override void InitializeAuthHandler(string authHandlerClassName, FilterConfig
                                               filterConfig)
 {
     // A single CuratorFramework should be used for a ZK cluster.
     // If the ZKSignerSecretProvider has already created it, it has to
     // be set here... to be used by the ZKDelegationTokenSecretManager
     ZKDelegationTokenSecretManager.SetCurator((CuratorFramework)filterConfig.GetServletContext
                                                   ().GetAttribute(ZKSignerSecretProvider.ZookeeperSignerSecretProviderCuratorClientAttribute
                                                                   ));
     base.InitializeAuthHandler(authHandlerClassName, filterConfig);
     ZKDelegationTokenSecretManager.SetCurator(null);
 }
Exemplo n.º 3
0
 /// <exception cref="Javax.Servlet.ServletException"/>
 protected internal virtual void InitializeSecretProvider(FilterConfig filterConfig
                                                          )
 {
     secretProvider = (SignerSecretProvider)filterConfig.GetServletContext().GetAttribute
                          (SignerSecretProviderAttribute);
     if (secretProvider == null)
     {
         // As tomcat cannot specify the provider object in the configuration.
         // It'll go into this path
         try
         {
             secretProvider = ConstructSecretProvider(filterConfig.GetServletContext(), config
                                                      , false);
             isInitializedByTomcat = true;
         }
         catch (Exception ex)
         {
             throw new ServletException(ex);
         }
     }
     signer = new Signer(secretProvider);
 }
Exemplo n.º 4
0
 /// <exception cref="Javax.Servlet.ServletException"/>
 public override void Init(FilterConfig filterConfig)
 {
     filterConfig.GetServletContext().SetAttribute(DelegationTokenAuthenticationFilter
                                                   .DelegationTokenSecretManagerAttr, manager);
     base.Init(filterConfig);
 }