public void Configure(AuthenticationOptions options)
        {
            var settings = GetMicrosoftAccountSettingsAsync().GetAwaiter().GetResult();

            if (settings == null)
            {
                return;
            }

            if (_microsoftAccountService.ValidateSettings(settings).Any())
            {
                return;
            }

            // Register the OpenID Connect client handler in the authentication handlers collection.
            options.AddScheme(MicrosoftAccountDefaults.AuthenticationScheme, builder =>
            {
                builder.DisplayName = "Microsoft Account";
                builder.HandlerType = typeof(MicrosoftAccountHandler);
            });
        }
        private async Task <MicrosoftAccountSettings> GetMicrosoftAccountSettingsAsync()
        {
            var settings = await _microsoftAccountService.GetSettingsAsync();

            if (_microsoftAccountService.ValidateSettings(settings).Any(result => result != ValidationResult.Success))
            {
                if (_shellSettings.State == TenantState.Running)
                {
                    _logger.LogWarning("The Microsoft Account Authentication is not correctly configured.");
                }

                return(null);
            }

            return(settings);
        }