Esempio n. 1
0
        /// <summary>
        /// Creates an ITicketProvider implementation. The instance is a singleton.
        /// </summary>
        /// <returns>A reference to the ITicketProvider implementation.</returns>
        public static ITicketProvider GetTicketProvider()
        {
            string          instanceName   = "";
            string          className      = "";
            string          assemblyName   = "";
            ITicketProvider ticketProvider = null;

            try
            {
                lock (ticketProviderLock)
                {
                    if (ticketProviderInstance == null)
                    {
                        SecuritySection           section = SecuritySection.GetSection();
                        ClassSpecificationElement spec    = section.TicketProvider;
                        instanceName           = spec.Name;
                        className              = spec.Class;
                        assemblyName           = spec.Assembly;
                        ticketProviderInstance = (ITicketProvider)Factory.CreateComponent(instanceName, className, assemblyName);
                    }
                    ticketProvider = ticketProviderInstance;
                }
            }
            catch (Exception exception)
            {
                throw new Exception("Failed to create ITicketProvider implementation.", exception);
            }
            return(ticketProvider);
        }
Esempio n. 2
0
    /// <summary>
    /// Sets the other partial classes and other necessary variables
    /// </summary>
    protected override void OnStart()
    {
        base.OnStart();

        SetCurrentSettings();

        settingsPopupAnimator = Animator as SettingsPopupAnimator;

        if (userWalletManager.ActiveWalletType == UserWalletManager.WalletType.Hope)
        {
            securitySection = new SecuritySection(idleTimeoutTimeCheckbox, loginAttemptsCheckbox, idleTimeoutTimeInputField, loginAttemptsInputField);

            twoFactorAuthenticationSection = new TwoFactorAuthenticationSection(twoFactorAuthCheckbox, setUpSection, keyText, qrCodeImage, codeInputField, confirmButton);

            walletNameSection = new WalletNameSection(hopeWalletInfoManager, walletPasswordVerification, contactsManager, dynamicDataCache, userWalletManager, settingsPopupAnimator, currentPasswordSection, changeWalletNameSection, currentPasswordloadingIcon, currentPasswordField, currentWalletNameField, newWalletNameField, nextButton, saveWalletNameButton, hopeOnlyCategoryButtons);

            passwordSection = new PasswordSection(playerPrefPasswordDerivation, userWalletManager, hopeWalletInfoManager, dynamicDataCache, settingsPopupAnimator, newPasswordField, confirmPasswordField, savePasswordButton, newPasswordLoadingIcon);
        }
        else
        {
            foreach (GameObject categoryButton in hopeOnlyCategoryButtons)
            {
                categoryButton.SetActive(false);
            }

            categoryLines[0].SetActive(false);
            categoryLines[1].SetActive(false);
        }

        selectables.Add(newPasswordField.InputFieldBase);
        selectables.Add(confirmPasswordField.InputFieldBase);
    }
Esempio n. 3
0
 private static void Initialize()
 {
     if (!_initialized)
     {
         lock (_lock)
         {
             if (!_initialized)
             {
                 try
                 {
                     SecuritySection section = ConfigurationManager.GetSection("lionsguard/security") as SecuritySection;
                     if (section != null)
                     {
                         _encryptIV  = section.IV;
                         _encryptKey = section.Key;
                     }
                     else
                     {
                         throw new ConfigurationErrorsException("The 'lionsguard/security' section of the application configuration file was not found.");
                     }
                 }
                 catch (Exception ex)
                 {
                     _initException = ex;
                 }
                 _initialized = true;
             }
         }
     }
     if (_initException != null)
     {
         throw _initException;
     }
 }
Esempio n. 4
0
 private static void InitCheckSecurityCodeElement()
 {
     if (_CheckSecurityCodeElement == null)
     {
         SecuritySection section = (SecuritySection)WebConfigurationManager.GetSection("EasyOne.web/security");
         _CheckSecurityCodeElement = section.CheckSecurityCode;
     }
 }
        public void Init(HttpApplication context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            //从当前 Web 应用程序的默认配置文件中检索指定的配置节
            SecuritySection section = (SecuritySection)WebConfigurationManager.GetSection("EasyOne.web/security");

            this.m_NoCheckUrlReferrerSection = section.NoCheckUrlReferrer;
            this.m_NoCheckAdminLogOnSection  = section.NoCheckAdminLogOn;
            context.BeginRequest            += new EventHandler(this.Application_BeginRequest);//将SecurityModule改为this
            //事件发出信号表示配置的身份验证机制已对当前请求进行了身份验证
            //订阅 AuthenticateRequest 事件可确保在处理附加模块或事件处理程序之前对请求进行身份验证。
            context.AuthenticateRequest += new EventHandler(this.Application_AuthenticateRequest);//将SecurityModule改为this
            //预订 PostAuthenticateRequest 事件的功能可以访问由 PostAuthenticateRequest 处理的任何数据。
            context.PostAuthenticateRequest += new EventHandler(this.Application_PostAuthenticateRequest);
        }
Esempio n. 6
0
        /// <summary>
        /// Инициализация OAuth-провайдеров
        /// </summary>
        public void Initialize()
        {
            OAuthProvidersCollection oAuthProviders = SecuritySection.GetConfiguration().OAuthProviders;

            foreach (OAuthProviderElement oAuthProviderElement in oAuthProviders)
            {
                string oAuthProviderName = oAuthProviderElement.ProviderName;
                if (_oAuthProviders.ContainsKey(oAuthProviderName))
                {
                    Activator.CreateInstance(_oAuthProviders[oAuthProviderName],
                                             oAuthProviderElement.AppId,
                                             oAuthProviderElement.AppSecret);
                }
                else
                {
                    throw new Exception(string.Format("Не найден OAuth-провайдер с именем {0}", oAuthProviderName));
                }
            }
        }
Esempio n. 7
0
        /// <summary>
        /// Creates ICredentials for an affiliate application.
        /// </summary>
        /// <param name="affiliateName">The name of the affiliate application for the credentials.</param>
        /// <returns>A reference to the ICredentials implementation.</returns>
        public static ICredentials GetCredentials(string affiliateName)
        {
            string       instanceName = "";
            string       className    = "";
            string       assemblyName = "";
            ICredentials credentials  = null;

            try
            {
                lock (credentialsLock)
                {
                    // Construct ist if needed.
                    if (credentialsList == null)
                    {
                        credentialsList = new Dictionary <string, ICredentials>();
                    }
                    // Check list for the requested affiliate.
                    if (credentialsList.ContainsKey(affiliateName))
                    {
                        credentials = credentialsList[affiliateName];
                    }
                    else
                    {
                        SecuritySection           section = SecuritySection.GetSection();
                        ClassSpecificationElement spec    = section.CredentialsProvider;
                        instanceName = affiliateName;
                        className    = spec.Class;
                        assemblyName = spec.Assembly;
                        credentials  = (ICredentials)Factory.CreateComponent(instanceName, className, assemblyName);
                        credentialsList[affiliateName] = credentials;
                    }
                }
            }
            catch (Exception exception)
            {
                throw new Exception("Failed to create ICredentials implementation.", exception);
            }
            return(credentials);
        }
Esempio n. 8
0
 public static void Initialise(TestContext testcontext)
 {
     SecuritySettings = (SecuritySection)ConfigurationManager.GetSection("passwordPolicies");
 }
 static PPIHandler()
 {
     _allowRemote = SecuritySection.Get().AllowRemote;
 }