public BaseAuthenticateController( IAuthenticateActions authenticateActions, IProfileActions profileActions, IDataProtectionProvider dataProtectionProvider, IEncoder encoder, ITranslationManager translationManager, IOpenIdEventSource simpleIdentityServerEventSource, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, IEventPublisher eventPublisher, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, IUserActions userActions, IPayloadSerializer payloadSerializer, IConfigurationService configurationService, IAuthenticateHelper authenticateHelper, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, BasicAuthenticateOptions basicAuthenticateOptions) : base(authenticationService) { _authenticateActions = authenticateActions; _profileActions = profileActions; _dataProtector = dataProtectionProvider.CreateProtector("Request"); _encoder = encoder; _translationManager = translationManager; _simpleIdentityServerEventSource = simpleIdentityServerEventSource; _urlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext); _eventPublisher = eventPublisher; _payloadSerializer = payloadSerializer; _authenticationSchemeProvider = authenticationSchemeProvider; _userActions = userActions; _configurationService = configurationService; _authenticateHelper = authenticateHelper; _basicAuthenticateOptions = basicAuthenticateOptions; _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; }
public AuthenticateController( IAuthenticateActions authenticateActions, IProfileActions profileActions, IDataProtectionProvider dataProtectionProvider, IEncoder encoder, ITranslationManager translationManager, IOpenIdEventSource simpleIdentityServerEventSource, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, IEventPublisher eventPublisher, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, IUserActions userActions, IPayloadSerializer payloadSerializer, IConfigurationService configurationService, IAuthenticateHelper authenticateHelper, IResourceOwnerAuthenticateHelper resourceOwnerAuthenticateHelper, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, BasicAuthenticateOptions basicAuthenticateOptions) : base(authenticateActions, profileActions, dataProtectionProvider, encoder, translationManager, simpleIdentityServerEventSource, urlHelperFactory, actionContextAccessor, eventPublisher, authenticationService, authenticationSchemeProvider, userActions, payloadSerializer, configurationService, authenticateHelper, twoFactorAuthenticationHandler, basicAuthenticateOptions) { _resourceOwnerAuthenticateHelper = resourceOwnerAuthenticateHelper; }
/// <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); }
public GenerateAndSendCodeAction( IResourceOwnerRepository resourceOwnerRepository, IConfirmationCodeStore confirmationCodeStore, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler) { _resourceOwnerRepository = resourceOwnerRepository; _confirmationCodeStore = confirmationCodeStore; _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; }
public GenerateAndSendCodeAction( IResourceOwnerRepository resourceOwnerRepository, IConfirmationCodeRepository confirmationCodeRepository, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, IAuthenticateResourceOwnerService authenticateResourceOwnerService) { _resourceOwnerRepository = resourceOwnerRepository; _confirmationCodeRepository = confirmationCodeRepository; _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; _authenticateResourceOwnerService = authenticateResourceOwnerService; }
public UserController(IUserActions userActions, IProfileActions profileActions, ITranslationManager translationManager, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler) : base(authenticationService) { _userActions = userActions; _profileActions = profileActions; _translationManager = translationManager; _authenticationSchemeProvider = authenticationSchemeProvider; _urlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext); _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; }
/// <summary> /// Initializes a new instance of the <see cref="UserController"/> class. /// </summary> /// <param name="resourceOwnerRepository">The resource owner repository.</param> /// <param name="authenticationService">The authentication service.</param> /// <param name="authenticationSchemeProvider">The authentication scheme provider.</param> /// <param name="urlHelperFactory">The URL helper factory.</param> /// <param name="actionContextAccessor">The action context accessor.</param> /// <param name="consentRepository">The consent repository.</param> /// <param name="scopeRepository"></param> /// <param name="twoFactorAuthenticationHandler">The two factor authentication handler.</param> /// <param name="logger">The logger</param> public UserController( IResourceOwnerRepository resourceOwnerRepository, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, IConsentRepository consentRepository, IScopeRepository scopeRepository, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, ILogger <UserController> logger) : base(authenticationService) { _resourceOwnerRepository = resourceOwnerRepository; _getUserOperation = new GetUserOperation(resourceOwnerRepository, logger); _updateUserTwoFactorAuthenticatorOperation = new UpdateUserTwoFactorAuthenticatorOperation(resourceOwnerRepository, logger); _authenticationSchemeProvider = authenticationSchemeProvider; _consentRepository = consentRepository; _scopeRepository = scopeRepository; _urlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext !); _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; _logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="AuthenticateController"/> class. /// </summary> /// <param name="smsClient">The SMS client.</param> /// <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="authorizationCodeStore">The authorization code store.</param> /// <param name="authenticationService">The authentication service.</param> /// <param name="authenticationSchemeProvider">The authentication scheme provider.</param> /// <param name="twoFactorAuthenticationHandler">The two factor authentication handler.</param> /// <param name="subjectBuilder">The subject builder.</param> /// <param name="consentRepository">The consent repository.</param> /// <param name="scopeRepository">The scope repository.</param> /// <param name="tokenStore">The token store.</param> /// <param name="resourceOwnerRepository">The resource owner repository.</param> /// <param name="confirmationCodeStore">The confirmation code store.</param> /// <param name="clientStore">The client store.</param> /// <param name="jwksStore">The JWKS store.</param> /// <param name="accountFilters">The account filters.</param> /// <param name="logger">The controller logger.</param> /// <param name="runtimeSettings">The runtime settings.</param> public AuthenticateController( ISmsClient smsClient, IDataProtectionProvider dataProtectionProvider, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, IEventPublisher eventPublisher, IAuthorizationCodeStore authorizationCodeStore, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, ISubjectBuilder subjectBuilder, IConsentRepository consentRepository, IScopeRepository scopeRepository, ITokenStore tokenStore, IResourceOwnerRepository resourceOwnerRepository, IConfirmationCodeStore confirmationCodeStore, IClientStore clientStore, IJwksStore jwksStore, IEnumerable <IAccountFilter> 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; _confirmationCodeStore = confirmationCodeStore; _logger = logger; _getUserOperation = new GetUserOperation(resourceOwnerRepository, logger); var generateSms = new GenerateAndSendSmsCodeOperation(smsClient, confirmationCodeStore, logger); _smsAuthenticationOperation = new SmsAuthenticationOperation( runtimeSettings, smsClient, confirmationCodeStore, resourceOwnerRepository, subjectBuilder, accountFilters.ToArray(), eventPublisher, logger); _validateConfirmationCode = new ValidateConfirmationCodeAction(confirmationCodeStore); _authenticateHelper = new AuthenticateHelper( authorizationCodeStore, tokenStore, scopeRepository, consentRepository, clientStore, jwksStore, eventPublisher, logger); _generateAndSendSmsCodeOperation = generateSms; }
public TwoFactorAuthenticationHandlerFixture() { _twoFactorAuthenticationHandler = new TwoFactorAuthenticationHandler(new[] { new Mock <ITwoFactorAuthenticationService>().Object, }); }
/// <summary> /// Initializes a new instance of the <see cref="BaseAuthenticateController"/> 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="twoFactorAuthenticationHandler">The two factor authentication handler.</param> /// <param name="authorizationCodeStore">The authorization code store.</param> /// <param name="consentRepository">The consent repository.</param> /// <param name="scopeRepository">The scope repository.</param> /// <param name="tokenStore">The token store.</param> /// <param name="resourceOwnerRepository">The resource owner repository.</param> /// <param name="confirmationCodeStore">The confirmation code store.</param> /// <param name="clientStore">The client store.</param> /// <param name="jwksStore"></param> /// <param name="subjectBuilder"></param> /// <param name="accountFilters">The account filters.</param> /// <param name="logger">The controller logger.</param> /// <param name="runtimeSettings">The runtime settings.</param> protected BaseAuthenticateController( IDataProtectionProvider dataProtectionProvider, IUrlHelperFactory urlHelperFactory, IActionContextAccessor actionContextAccessor, IEventPublisher eventPublisher, IAuthenticationService authenticationService, IAuthenticationSchemeProvider authenticationSchemeProvider, ITwoFactorAuthenticationHandler twoFactorAuthenticationHandler, IAuthorizationCodeStore authorizationCodeStore, IConsentRepository consentRepository, IScopeRepository scopeRepository, ITokenStore tokenStore, IResourceOwnerRepository resourceOwnerRepository, IConfirmationCodeStore confirmationCodeStore, IClientStore clientStore, IJwksStore jwksStore, ISubjectBuilder subjectBuilder, IEnumerable <IAccountFilter> accountFilters, ILogger logger, RuntimeSettings runtimeSettings) : base(authenticationService) { _generateAndSendCode = new GenerateAndSendCodeAction( resourceOwnerRepository, confirmationCodeStore, twoFactorAuthenticationHandler, logger); _validateConfirmationCode = new ValidateConfirmationCodeAction(confirmationCodeStore); _authenticateHelper = new AuthenticateHelper( authorizationCodeStore, tokenStore, scopeRepository, consentRepository, clientStore, jwksStore, eventPublisher, logger); _authenticateResourceOwnerOpenId = new AuthenticateResourceOwnerOpenIdAction( authorizationCodeStore, tokenStore, scopeRepository, consentRepository, clientStore, jwksStore, eventPublisher, logger); DataProtector = dataProtectionProvider.CreateProtector("Request"); _urlHelper = urlHelperFactory.GetUrlHelper(actionContextAccessor.ActionContext !); _eventPublisher = eventPublisher; _authenticationSchemeProvider = authenticationSchemeProvider; _addUser = new AddUserOperation( runtimeSettings, resourceOwnerRepository, accountFilters, subjectBuilder, eventPublisher); _getUserOperation = new GetUserOperation(resourceOwnerRepository, logger); _updateUserClaimsOperation = new UpdateUserClaimsOperation(resourceOwnerRepository, logger); _runtimeSettings = runtimeSettings; _twoFactorAuthenticationHandler = twoFactorAuthenticationHandler; _resourceOwnerRepository = resourceOwnerRepository; _confirmationCodeStore = confirmationCodeStore; _logger = logger; }
private void InitializeFakeObjects() { _twoFactorAuthenticationHandler = new TwoFactorAuthenticationHandler(null); }
private void InitializeFakeObjects() { _twoFactorServiceStore = new Mock <ITwoFactorServiceStore>(); _twoFactorAuthenticationHandler = new TwoFactorAuthenticationHandler(_twoFactorServiceStore.Object); }