public ActionResult Configure()
        {
			if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods))
				return Content("Access denied");

            var model = new ConfigurationModel();
            model.ClientKeyIdentifier = _facebookExternalAuthSettings.ClientKeyIdentifier;
            model.ClientSecret = _facebookExternalAuthSettings.ClientSecret;
            
            return View(model);
        }
        public ActionResult Configure(ConfigurationModel model)
        {
			if (!_permissionService.Authorize(StandardPermissionProvider.ManageExternalAuthenticationMethods))
				return Content("Access denied");

            if (!ModelState.IsValid)
                return Configure();
            
            //save settings
            _facebookExternalAuthSettings.ClientKeyIdentifier = model.ClientKeyIdentifier;
            _facebookExternalAuthSettings.ClientSecret = model.ClientSecret;
            _settingService.SaveSetting(_facebookExternalAuthSettings);
            
            return View(model);
        }
        public ActionResult Configure()
        {
            if (!HasPermission(false))
                return AccessDeniedPartialView();

            var model = new ConfigurationModel();
            int storeScope = this.GetActiveStoreScopeConfiguration(_services.StoreService, _services.WorkContext);
            var settings = _services.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);

            model.ClientKeyIdentifier = settings.ClientKeyIdentifier;
            model.ClientSecret = settings.ClientSecret;

            var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
            storeDependingSettingHelper.GetOverrideKeys(settings, model, storeScope, _services.Settings);

            return View(model);
        }
        public ActionResult Configure(ConfigurationModel model, FormCollection form)
        {
            if (!HasPermission(false))
                return Configure();

            if (!ModelState.IsValid)
                return Configure();

            var storeDependingSettingHelper = new StoreDependingSettingHelper(ViewData);
            int storeScope = this.GetActiveStoreScopeConfiguration(_services.StoreService, _services.WorkContext);
            var settings = _services.Settings.LoadSetting<FacebookExternalAuthSettings>(storeScope);

            settings.ClientKeyIdentifier = model.ClientKeyIdentifier;
            settings.ClientSecret = model.ClientSecret;

            storeDependingSettingHelper.UpdateSettings(settings, form, storeScope, _services.Settings);
            _services.Settings.ClearCache();

            NotifySuccess(_services.Localization.GetResource("Admin.Common.DataSuccessfullySaved"));

            return Configure();
        }