/// <summary>
        /// Получить вызов.
        /// </summary>
        /// <param name="input">Ввод.</param>
        /// <returns>Задача с выводом.</returns>
        public async Task <ModIdentityServerWebMvcPartExternalJobChallengeGetOutput> GetChallenge(
            ModIdentityServerWebMvcPartExternalJobChallengeGetInput input
            )
        {
            if (string.IsNullOrEmpty(input.ReturnUrl))
            {
                input.ReturnUrl = "~/";
            }

            var authenticationProperties = new AuthenticationProperties
            {
                RedirectUri = input.RedirectUrl,
                Items       =
                {
                    { "returnUrl", input.ReturnUrl },
                    { "scheme",    input.Provider  },
                }
            };

            input.Status = await ProcessChallengeGet(
                authenticationProperties,
                input.Provider,
                input.ReturnUrl,
                input.HttpContext,
                input.UrlHelper,
                input.Interaction
                ).CoreBaseExtTaskWithCurrentCulture(false);

            return(new ModIdentityServerWebMvcPartExternalJobChallengeGetOutput
            {
                AuthenticationProperties = authenticationProperties
            });
        }
Esempio n. 2
0
            ) BuildActionChallengeGet(ModIdentityServerWebMvcPartExternalJobChallengeGetInput input)
        {
            input.Interaction = ExtInteraction;

            var job = AppJobChallengeGet;

            Task <ModIdentityServerWebMvcPartExternalJobChallengeGetOutput> execute() => job.Execute(input);

            void onSuccess(ModIdentityServerWebMvcPartExternalJobChallengeGetResult result)
            {
                job.OnSuccess(ExtLogger, result, input);
            }

            void onError(Exception ex, ModIdentityServerWebMvcPartExternalJobChallengeGetResult result)
            {
                job.OnError(ex, ExtLogger, result);
            }

            return(execute, onSuccess, onError);
        }