public async Task <IActionResult> Index()
        {
            if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageValidationSettings))
            {
                return(Forbid());
            }

            var settings = await _validationService.GetSettingsAsync();

            var shape = await _validationSettingsDisplayManager.BuildEditorAsync(settings, updater : _updateModelAccessor.ModelUpdater, isNew : false);

            return(View(shape));
        }
Exemplo n.º 2
0
        private async Task <OpenIdValidationSettings> GetValidationSettingsAsync()
        {
            var settings = await _validationService.GetSettingsAsync();

            if ((await _validationService.ValidateSettingsAsync(settings)).Any(result => result != ValidationResult.Success))
            {
                _logger.LogWarning("The OpenID Connect module is not correctly configured.");

                return(null);
            }

            return(settings);
        }
        public async Task ProcessDeploymentStepAsync(DeploymentStep step, DeploymentPlanResult result)
        {
            var openIdValidationStep = step as OpenIdValidationDeploymentStep;

            if (openIdValidationStep == null)
            {
                return;
            }

            var validationSettings = await _openIdValidationService.GetSettingsAsync();

            result.Steps.Add(new JObject(
                                 new JProperty("name", "OpenIdValidation"),
                                 new JProperty("OpenIdValidation", JObject.FromObject(validationSettings))
                                 ));
        }