Esempio n. 1
0
		public static void RunServiceAsSpaceOwner(WebServicesClientProtocol proxy)
		{
			// impersonate as space owner
			string username = EcommerceSettings.GetSetting("OwnerUsername");
			string password = EcommerceSettings.GetSetting("OwnerPassword");

			if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password))
			{
				EnterpriseServerProxyConfigurator config = new EnterpriseServerProxyConfigurator();

				config.EnterpriseServerUrl = EcommerceSettings.GetSetting("EnterpriseServer");
				config.Username = username;
				config.Password = password;

				config.Configure(proxy);
			}
			else
				throw new Exception("Ecommerce doesn't configured correctly, please review SitesSettings/Ecommerce section");
		}
Esempio n. 2
0
		public static void Configure(WebServicesClientProtocol proxy, bool applyPolicy)
		{
			if (applyPolicy && !HttpContext.Current.Request.IsAuthenticated)
			{
				// impersonate as space owner
				string username = EcommerceSettings.GetSetting("OwnerUsername");
				string password = EcommerceSettings.GetSetting("OwnerPassword");

				if (!String.IsNullOrEmpty(username) && !String.IsNullOrEmpty(password))
				{
					EnterpriseServerProxyConfigurator config = new EnterpriseServerProxyConfigurator();

					config.EnterpriseServerUrl = EcommerceSettings.GetSetting("EnterpriseServer");
					config.Username = username;
					config.Password = password;

					config.Configure(proxy);

					return;
				}
			}
			
			PortalUtils.ConfigureEnterpriseServerProxy(proxy, applyPolicy);
        }
Esempio n. 3
0
        public static void ConfigureEnterpriseServerProxy(WebServicesClientProtocol proxy, bool applyPolicy)
        {
            // load ES properties
            string serverUrl = PortalConfiguration.SiteSettings["EnterpriseServer"];

            EnterpriseServerProxyConfigurator cnfg = new EnterpriseServerProxyConfigurator();
            cnfg.EnterpriseServerUrl = serverUrl;

            // create assertion
            if (applyPolicy)
            {
                if (AuthTicket != null)
                {
                    cnfg.Username = AuthTicket.Name;
                    cnfg.Password = AuthTicket.UserData.Substring(0, AuthTicket.UserData.IndexOf(Environment.NewLine));
                }
            }

            cnfg.Configure(proxy);
        }
        private void SetupProxy(Microsoft.Web.Services3.WebServicesClientProtocol proxy,
            string username, string password)
        {
            // create ES configurator
            string serverUrl = ConfigurationManager.AppSettings["AWStats.WebsitePanelAuthenticationProvider.EnterpriseServer"];
            if (String.IsNullOrEmpty(serverUrl))
                throw new Exception("Enterprise Server URL could not be empty");

            EnterpriseServerProxyConfigurator cnfg = new EnterpriseServerProxyConfigurator();
            cnfg.EnterpriseServerUrl = serverUrl;
            cnfg.Username = username;
            cnfg.Password = password;
            cnfg.Configure(proxy);
        }