public void SetUp() { service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>(); Handler = new InsertarUsuarioHandler(Logger, service, Mapper); user = UserMock.UserModelMock(); }
public AuthService(IAuthDbService authDbService, IUserDbService <TUserModel> userService, JwtGenerator jwtGenerator, IMapper mapper) { _authDbService = authDbService ?? throw new ProjectArgumentException( GetType(), nameof(AuthService <TUserModel>), nameof(authDbService), null); _userDbService = userService ?? throw new ProjectArgumentException( GetType(), nameof(AuthService <TUserModel>), nameof(userService), null); _jwtGenerator = jwtGenerator ?? throw new ProjectArgumentException( GetType(), nameof(AuthService <TUserModel>), nameof(jwtGenerator), null); _mapper = mapper ?? throw new ProjectArgumentException( GetType(), nameof(AuthService <TUserModel>), nameof(mapper), null); }
public void attachUserToContext(HttpContext context, IUserDbService service, string token) { try { var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.ASCII.GetBytes(_jwtSettings.secretKey); tokenHandler.ValidateToken(token, new TokenValidationParameters { ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(key), ValidateIssuer = false, ValidateAudience = false, ClockSkew = TimeSpan.Zero }, out SecurityToken validatedToken ); var jwtToken = (JwtSecurityToken)validatedToken; var IdUser = int.Parse(jwtToken.Claims.First(x => x.Type == "IdUser").Value); context.Items["User"] = service.GetUser(IdUser); } catch { } }
public AdminController(ICustomerService customerService, IDepartmentService departmentService, IUserDbService userDbService) { _customerService = customerService; _departmentService = departmentService; _userDbService = userDbService; }
public MocksController(IDepartmentService departmentService, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, IUserDbService userService) { _departmentService = departmentService; _userManager = userManager; _roleManager = roleManager; _userService = userService; }
public BaseController() { userService = new UserDbService(); brandsService = new BrandsDbService(); siteService = new SitePageDbService(); siteSettings = new SiteSettingsDbService(); categoryDbService = new CategoryDbService(); ImageSlider = new ImageSlider(); productService = new ProductsDbService(); }
public async Task Invoke(HttpContext context, IUserDbService service) { var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(' ').Last(); //token z headera if (token != null) { attachUserToContext(context, service, token); } await _next(context); }
public UsersInfoController(IUserDbService userDbService, IDepartmentService departmentService, ICustomerService customerService, UserManager <User> userManager ) { _userDbService = userDbService; _departmentService = departmentService; _customerService = customerService; _userManager = userManager; }
public AccountController(IUserDbService userDbService, IDepartmentService departmentService, SignInManager <User> signInManager, ILogger <AccountController> logger, UserManager <User> userManager) { _userDbService = userDbService; _departmentService = departmentService; _signInManager = signInManager; _logger = logger; _userManager = userManager; }
public UserOperationService(IUserDbService userDbService) { this._userDbService = userDbService; }
public UsersController(IUserDbService userDBService, IHttpMessageConfiguerer httpResponseMessageConfiguerer) { _userDBService = userDBService; _httpResponseMessageConfiguerer = httpResponseMessageConfiguerer; }
public UserService() { userDb = new UserDbService(); }
public PodCastController(MediaDbContext context, UserManager <MediaWebUser> userManager, IUserDbService dbService) { _mediaDbContext = context; _userManager = userManager; _userDbService = dbService; }
public AuthorizationService() { _userDbService = UnityConfig.GetConfiguredContainer().Resolve <IUserDbService>(); }
public ActualizarUsuarioHandler(ILogger <ActualizarUsuarioHandler> logger, IUserDbService service, IMapper mapper) { this.logger = logger; this.service = service; this.mapper = mapper; }
public UserController(IUserDbService services) { _services = services; }
public UserAppService(IUserDbService userDb, IUserSubscriptionDbService subscriptionDbService) { this._UserDb = userDb; this._SubscriptionDbService = subscriptionDbService; }
public UserController(IUserDbService dbService, IConfiguration configuration) { _dbService = dbService; Configuration = configuration; }
public ObtenerUsuariosHandler(ILogger <ObtenerUsuariosHandler> logger, IUserDbService service, IMapper mapper) { this.logger = logger; this.service = service; this.mapper = mapper; }
public AuthenticationHandler(IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IUserDbService userService) : base(options, logger, encoder, clock) { _userContext = userService; }
public UserDbIntegration(IUserDbService userIDbService) { _userIDbService = userIDbService; }
public AuthenticationService(IUserDbService userService) { _userService = userService; }
public EliminarUsuarioHandler(ILogger <EliminarUsuarioHandler> logger, IUserDbService service, IMapper mapper) { this.logger = logger; this.service = service; this.mapper = mapper; }
public void SetUp() { service = ServiceBuilder <ChallengeDbContext, UserEntity> .GetService <UserDbService>(); Handler = new EliminarUsuarioHandler(Logger, service, Mapper); }