Example #1
0
        public UserServiceTest()
        {
            _passwordHash                  = A.Fake <IPasswordHashService>();
            _userRepositoryService         = A.Fake <IUserRepositoryService>();
            _jwtService                    = A.Fake <IJsonWebTokenService>();
            _httpRequestParser             = A.Fake <IHttpRequestParser>();
            _emailService                  = A.Fake <IEmailService>();
            _factorAuthenticatorManager    = A.Fake <ITwoFactorAuthenticatorManager>();
            _loginAttemptRepoService       = A.Fake <ILoginAttemptsRepositoryService>();
            _refreshTokenRepositoryService = A.Fake <IRefreshTokenRepositoryService>();
            _whiteListRepostirotyService   = A.Fake <IWhitelistedIpRepositoryService>();

            _userService = new UserService
                           (
                _userRepositoryService,
                _passwordHash,
                _jwtService,
                _httpRequestParser,
                _emailService,
                _factorAuthenticatorManager,
                _whiteListRepostirotyService,
                _loginAttemptRepoService,
                _refreshTokenRepositoryService
                           );
        }
 public TwoFactorAuthenticationController
 (
     IUserService userService,
     ITokenValidationService tokenValidationService,
     ITwoFactorAuthenticatorManager twoFactorAuthenticatorManager,
     IJsonWebTokenService jsonWebTokenService
 )
 {
     _userService                   = userService;
     _tokenValidationService        = tokenValidationService;
     _twoFactorAuthenticatorManager = twoFactorAuthenticatorManager;
     _jsonWebTokenService           = jsonWebTokenService;
 }
Example #3
0
        public AccountController
        (
            IUserService userService,
            IConfiguration configuration,
            IEmailService emailService,
            ITokenValidationService tokenValidationService,
            ITwoFactorAuthenticatorManager twoFactorAuthenticatorManager,
            IJsonWebTokenService jsonWebTokenService
        )
        {
            _userService                   = userService;
            _emailService                  = emailService;
            _tokenValidationService        = tokenValidationService;
            _twoFactorAuthenticatorManager = twoFactorAuthenticatorManager;
            _jsonWebTokenService           = jsonWebTokenService;

            var host   = configuration["Hosting:Domain"];
            var scheme = configuration["Hosting:Scheme"];
            var port   = int.Parse(configuration["Hosting:Port"]);

            _baseUrl = $"{scheme}://{host}:{port}";
        }
Example #4
0
 public UserService
 (
     IUserRepositoryService userRepositoryService,
     IPasswordHashService passwordHashService,
     IJsonWebTokenService jwtService,
     IHttpRequestParser httpRequestParser,
     IEmailService emailService,
     ITwoFactorAuthenticatorManager factorAuthenticatorManager,
     IWhitelistedIpRepositoryService whitelistedIpRepositoryService,
     ILoginAttemptsRepositoryService loginAttemptsRepositoryService,
     IRefreshTokenRepositoryService refreshTokenRepositoryService
 )
 {
     _userRepositoryService          = userRepositoryService;
     _passwordHashService            = passwordHashService;
     _jwtService                     = jwtService;
     _httpRequestParser              = httpRequestParser;
     _emailService                   = emailService;
     _factorAuthenticatorManager     = factorAuthenticatorManager;
     _whitelistedIpRepositoryService = whitelistedIpRepositoryService;
     _loginAttemptsRepositoryService = loginAttemptsRepositoryService;
     _refreshTokenRepositoryService  = refreshTokenRepositoryService;
 }