示例#1
0
 public UsersService(IUsersRepository usersRepository, IHashPasswordService hashPasswordService, ITokenService tokenService, IMapper mapper)
 {
     _usersRepository     = usersRepository;
     _hashPasswordService = hashPasswordService;
     _tokenService        = tokenService;
     _mapper = mapper;
 }
示例#2
0
 public SignUpService(IEmployerRepository employerRepository, IBuilderRepository builderRepository, IHashPasswordService hashPasswordService, IMapper mapper)
 {
     this._employerRepository  = employerRepository;
     this._builderRepository   = builderRepository;
     this._hashPasswordService = hashPasswordService;
     this._mapper = mapper;
 }
示例#3
0
 public AuthenticateUserUseCase(IRetrieveUserRepository userRetriever, IHashPasswordService passwordHasher, ICreateAuthenticationRepository authCreator, IProvideAuthDuration authDurationProvider)
 {
     this.userRetriever        = userRetriever;
     this.passwordHasher       = passwordHasher;
     this.authCreator          = authCreator;
     this.authDurationProvider = authDurationProvider;
 }
示例#4
0
 public RandomHashedPasswordProvider(IHashPasswordService hashPasswordService)
 {
     if (hashPasswordService == null)
     {
         throw new ArgumentNullException(nameof(hashPasswordService));
     }
     RandomHashedPassword = hashPasswordService.Hash(new PlainTextPassword(Guid.NewGuid().ToString()));
 }
示例#5
0
 public ClienteBusiness(ILogger <ClienteBusiness> logger, IHashPasswordService hashPasswordService, IOptions <AppSettings> appSettings, IMapper mapper, IClienteDAO clienteDAO)
 {
     _logger = logger;
     _hashPasswordService = hashPasswordService;
     _appSettings         = appSettings.Value;
     _mapper     = mapper;
     _clienteDAO = clienteDAO;
 }
 public FuncionarioBusiness(ILogger <FuncionarioBusiness> logger, IHashPasswordService hashPasswordService, IOptions <AppSettings> appSettings, IMapper mapper, IFuncionarioDAO funcionarioDAO)
 {
     _logger = logger;
     _hashPasswordService = hashPasswordService;
     _appSettings         = appSettings.Value;
     _mapper         = mapper;
     _funcionarioDAO = funcionarioDAO;
 }
 public AdministradorBusiness(ILogger <AdministradorBusiness> logger, IHashPasswordService hashPasswordService, IOptions <AppSettings> appSettings, IMapper mapper, IAdministradorDAO administradorDAO)
 {
     _logger = logger;
     _hashPasswordService = hashPasswordService;
     _appSettings         = appSettings.Value;
     _mapper           = mapper;
     _administradorDAO = administradorDAO;
 }
示例#8
0
        public static void EnsureSeeded(this BlogContext context, IHashPasswordService service)
        {
            if (!context.Users.Any())
            {
                var users = JsonConvert.DeserializeObject <List <User> >(File.ReadAllText($"seed{Path.DirectorySeparatorChar}users.json"));

                users.ForEach(service.AddSaltAndHashPassword);

                context.AddRange(users);
                context.SaveChanges();
            }
        }
 public UsernamePasswordAuthenticateUserService(
     IUserDataService userDataService,
     IRandomHashedPasswordProvider randomHashedPasswordProvider,
     IHashPasswordService hashPasswordService,
     IValidator <UsernamePasswordCredentials> usernamePasswordCredentialsValidator,
     IAuthenticationSchemeProvider authenticationSchemeProvider)
 {
     _userDataService = userDataService ?? throw new ArgumentNullException(nameof(userDataService));
     _usernamePasswordCredentialsValidator = usernamePasswordCredentialsValidator ?? throw new ArgumentNullException(nameof(usernamePasswordCredentialsValidator));
     _authenticationSchemeProvider         = authenticationSchemeProvider ?? throw new ArgumentNullException(nameof(authenticationSchemeProvider));
     _randomHashedPasswordProvider         = randomHashedPasswordProvider ?? throw new ArgumentNullException(nameof(randomHashedPasswordProvider));
     _hashPasswordService = hashPasswordService ?? throw new ArgumentNullException(nameof(hashPasswordService));
 }
示例#10
0
 public CreateUserUseCase(ICreateUserRepository userCreator, IRetrieveUserRepository userRetriever, IHashPasswordService passwordHasher)
 {
     this.userCreator    = userCreator;
     this.userRetriever  = userRetriever;
     this.passwordHasher = passwordHasher;
 }