/// <summary>
        /// Initializes a new instance of the <see cref="AuthenticateController"/> class.
        /// </summary>
        /// <param name="dataProtectionProvider">The data protection provider.</param>
        /// <param name="urlHelperFactory">The URL helper factory.</param>
        /// <param name="actionContextAccessor">The action context accessor.</param>
        /// <param name="eventPublisher">The event publisher.</param>
        /// <param name="authenticationService">The authentication service.</param>
        /// <param name="authenticationSchemeProvider">The authentication scheme provider.</param>
        /// <param name="resourceOwnerServices">The resource owner services.</param>
        /// <param name="twoFactorAuthenticationHandler">The two factor authentication handler.</param>
        /// <param name="subjectBuilder">The subject builder.</param>
        /// <param name="authorizationCodeStore">The authorization code store.</param>
        /// <param name="scopeRepository">The scope repository.</param>
        /// <param name="tokenStore">The token store.</param>
        /// <param name="consentRepository">The consent repository.</param>
        /// <param name="confirmationCodeStore">The confirmation code store.</param>
        /// <param name="clientStore">The client store.</param>
        /// <param name="resourceOwnerRepository">The resource owner repository.</param>
        /// <param name="jwksStore"></param>
        /// <param name="accountFilters">The account filters.</param>
        /// <param name="logger">The controller logger.</param>
        /// <param name="runtimeSettings">The runtime settings.</param>
        public AuthenticateController(
            IDataProtectionProvider dataProtectionProvider,
            IUrlHelperFactory urlHelperFactory,
            IActionContextAccessor actionContextAccessor,
            IEventPublisher eventPublisher,
            IAuthenticationService authenticationService,
            IAuthenticationSchemeProvider authenticationSchemeProvider,
            IEnumerable <IAuthenticateResourceOwnerService> resourceOwnerServices,
            ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler,
            ISubjectBuilder subjectBuilder,
            IAuthorizationCodeStore authorizationCodeStore,
            IScopeRepository scopeRepository,
            ITokenStore tokenStore,
            IConsentRepository consentRepository,
            IConfirmationCodeStore confirmationCodeStore,
            IClientStore clientStore,
            IResourceOwnerRepository resourceOwnerRepository,
            IJwksStore jwksStore,
            IEnumerable <AccountFilter> accountFilters,
            ILogger <AuthenticateController> logger,
            RuntimeSettings runtimeSettings)
            : base(
                dataProtectionProvider,
                urlHelperFactory,
                actionContextAccessor,
                eventPublisher,
                authenticationService,
                authenticationSchemeProvider,
                twoFactorAuthenticationHandler,
                authorizationCodeStore,
                consentRepository,
                scopeRepository,
                tokenStore,
                resourceOwnerRepository,
                confirmationCodeStore,
                clientStore,
                jwksStore,
                subjectBuilder,
                accountFilters,
                logger,
                runtimeSettings)
        {
            _eventPublisher = eventPublisher;
            _logger         = logger;
            var services = resourceOwnerServices.ToArray();

            _resourceOwnerServices     = services;
            _localOpenIdAuthentication = new LocalOpenIdUserAuthenticationAction(
                authorizationCodeStore,
                services,
                consentRepository,
                tokenStore,
                scopeRepository,
                clientStore,
                jwksStore,
                eventPublisher,
                logger);
        }
        private void InitializeFakeObjects(params IAuthenticateResourceOwnerService[] services)
        {
            var mock = new Mock <IClientStore>();

            mock.Setup(x => x.GetById(It.IsAny <string>(), It.IsAny <CancellationToken>())).ReturnsAsync(new Client());
            _localUserAuthenticationAction = new LocalOpenIdUserAuthenticationAction(
                new Mock <IAuthorizationCodeStore>().Object,
                services,
                new Mock <IConsentRepository>().Object,
                new Mock <ITokenStore>().Object,
                new Mock <IScopeRepository>().Object,
                mock.Object,
                new InMemoryJwksRepository(),
                new NoOpPublisher(),
                new TestOutputLogger("test", _outputHelper));
        }