Example #1
0
        private async Task <GithubAuthenticationSettings> GetGithubAuthenticationSettingsAsync()
        {
            var settings = await _githubAuthenticationService.GetSettingsAsync();

            if ((_githubAuthenticationService.ValidateSettings(settings)).Any(result => result != ValidationResult.Success))
            {
                _logger.LogWarning("The Microsoft Account Authentication is not correctly configured.");

                return(null);
            }
            return(settings);
        }
Example #2
0
        public async Task ExecuteAsync(RecipeExecutionContext context)
        {
            if (!string.Equals(context.Name, nameof(GithubAuthenticationSettings), StringComparison.OrdinalIgnoreCase))
            {
                return;
            }
            var model    = context.Step.ToObject <GithubLoginSettingsStepModel>();
            var settings = await _githubAuthenticationService.GetSettingsAsync();

            settings.ClientID     = model.ConsumerKey;
            settings.ClientSecret = model.ConsumerSecret;
            settings.CallbackPath = model.CallbackPath;
            await _githubAuthenticationService.UpdateSettingsAsync(settings);
        }