Exemplo n.º 1
0
        public AccountController(
            IApplicationUserManager usersService,
            ITokenStoreService tokenStoreService,
            ITokenFactoryService tokenFactoryService,
            IApplicationSignInManager signInManager,
            IUnitOfWork uow

            )
        {
            _usersService = usersService;
            _usersService.CheckArgumentIsNull(nameof(usersService));

            _tokenStoreService = tokenStoreService;
            _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _signInManager = signInManager;
            _signInManager.CheckArgumentIsNull(nameof(_signInManager));


            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 2
0
        public AccountController(
            IUsersService usersService,
            ITokenStoreService tokenStoreService,
            ITokenFactoryService tokenFactoryService,
            IUnitOfWork uow,
            IAntiForgeryCookieService antiforgery,
            ITagServices tagServices,
            IZirReshtehServices zirReshteh
            )
        {
            _zirreshteh   = zirReshteh;
            _Tags         = tagServices;
            _usersService = usersService;
            _usersService.CheckArgumentIsNull(nameof(usersService));

            _tokenStoreService = tokenStoreService;
            _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _antiforgery = antiforgery;
            _antiforgery.CheckArgumentIsNull(nameof(antiforgery));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 3
0
        public JwtSignInManager(UserManager <TUser> userManager,
                                IHttpContextAccessor contextAccessor,
                                IOptions <IdentityOptions> optionsAccessor,
                                ILogger <JwtSignInManager <TUser> > logger,
                                IAuthenticationSchemeProvider schemes,
                                IUserConfirmation <TUser> confirmation,
                                ITokenFactoryService <TUser> tokenFactoryService)
        {
            if (userManager == null)
            {
                throw new ArgumentNullException(nameof(userManager));
            }
            if (contextAccessor == null)
            {
                throw new ArgumentNullException(nameof(contextAccessor));
            }


            UserManager          = userManager;
            Options              = optionsAccessor?.Value ?? new IdentityOptions();
            Logger               = logger;
            _schemes             = schemes;
            _confirmation        = confirmation;
            _tokenFactoryService = tokenFactoryService;
            _contextAccessor     = contextAccessor;
        }
Exemplo n.º 4
0
 public AccountController(IUsersService usersService, ITokenFactoryService tokenFactoryService,
                          ITokenStoreService tokenStoreService, IMapper mapper)
 {
     _usersService        = usersService;
     _tokenFactoryService = tokenFactoryService;
     _tokenStoreService   = tokenStoreService;
     _mapper = mapper;
 }
Exemplo n.º 5
0
 public TokenStoreService(ApplicationDbContext context,
                          ISecurityService securityService,
                          ITokenFactoryService tokenFactoryService,
                          IOptionsSnapshot <BearerTokensOptions> configuration)
 {
     _securityService     = securityService;
     _tokenFactoryService = tokenFactoryService;
     _configuration       = configuration;
 }
Exemplo n.º 6
0
 public TokenStoreService(
     IEncryptionService encryptionService,
     ITokenFactoryService tokenFactoryService,
     IRepository <CustomerToken> customerTokenRepository,
     JwtConfig jwtConfig)
 {
     _encryptionService       = encryptionService;
     _tokenFactoryService     = tokenFactoryService;
     _customerTokenRepository = customerTokenRepository;
     _jwtConfig = jwtConfig;
 }
Exemplo n.º 7
0
 public TokenStoreService(
     CorporateDb corporateDb,
     ISecurityService securityService,
     IOptionsSnapshot <BearerTokensOptions> configuration,
     ITokenFactoryService tokenFactoryService) : base(corporateDb)
 {
     _configuration = configuration;
     //_configuration.CheckArgumentIsNull(nameof(configuration));
     _securityService     = securityService;
     _tokenFactoryService = tokenFactoryService;
     //_tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
 }
        public TokenStoreService(
            IUserTokenRepository userTokenRepository,
            IOptionsSnapshot <BearerTokensOptions> configuration,
            ITokenFactoryService tokenFactoryService)
        {
            _userTokenRepository = userTokenRepository;

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 9
0
 public AccountService(ITokenFactoryService tokenFactoryService,
                       ITokenStoreService tokenStoreService,
                       IUnitOfWork uow,
                       IAntiForgeryCookieService antiforgery)
 {
     _tokenFactoryService = tokenFactoryService;
     _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
     _uow         = uow;
     _antiforgery = antiforgery;
     _antiforgery.CheckArgumentIsNull(nameof(antiforgery));
     _tokenStoreService = tokenStoreService;
     _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));
 }
Exemplo n.º 10
0
 public Handler(UserManager <AppUser> userManager
                , SignInManager <AppUser> signInManager
                , IOptions <SiteSettings> siteSettings
                , ITokenFactoryService tokenFactory
                , ITokenStoreService tokenStoreService
                , ApplicationDbContext context)
 {
     _userManager       = userManager;
     _signInManager     = signInManager;
     _siteSettings      = siteSettings;
     _tokenFactory      = tokenFactory;
     _tokenStoreService = tokenStoreService;
     _context           = context;
 }
Exemplo n.º 11
0
 public CustomerController(IPermissionService permissionService,
                           ILocalizationService localizationService,
                           ITokenStoreService tokenStoreService,
                           ITokenFactoryService tokenFactoryService,
                           IWorkContext workContext,
                           IGenericAttributeService genericAttributeService)
 {
     _permissionService       = permissionService;
     _localizationService     = localizationService;
     _tokenStoreService       = tokenStoreService;
     _tokenFactoryService     = tokenFactoryService;
     _workContext             = workContext;
     _genericAttributeService = genericAttributeService;
 }
Exemplo n.º 12
0
        public TokenStoreService(IUnitOfWork uow, ISecurityService securityService, IOptionsSnapshot <BearerTokensOptions> configuration, ITokenFactoryService tokenFactoryService)
        {
            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _securityService = securityService;
            _securityService.CheckArgumentIsNull(nameof(_securityService));

            _tokens = _uow.Set <UserToken>();

            _configuration = configuration;
            _configuration.CheckArgumentIsNull(nameof(configuration));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 13
0
 public TokenStoreService(
     IRepository <Auth_UserToken> tokenUserRepository,
     IUserService userServices,
     IStaticCacheManager staticCacheManager,
     ITokenFactoryService tokenFactoryService,
     IEncryptionService encryptionService,
     IOptionsSnapshot <BearerTokensOptions> configuration
     )
 {
     _tokenUserRepository = tokenUserRepository;
     _userServices        = userServices;
     _staticCacheManager  = staticCacheManager;
     _tokenFactoryService = tokenFactoryService;
     _encryptionService   = encryptionService;
     _configuration       = configuration;
 }
Exemplo n.º 14
0
        public AuthControllerTest() : base()
        {
            _usersService        = base._serviceProvider.GetRequiredService <IUsersService>();
            _tokenStoreService   = base._serviceProvider.GetRequiredService <ITokenStoreService>();
            _tokenFactoryService = base._serviceProvider.GetRequiredService <ITokenFactoryService>();
            _uow = base._serviceProvider.GetRequiredService <IUnitOfWork>();

            var httpContextAccessor = new HttpContextAccessor();

            httpContextAccessor.HttpContext = new DefaultHttpContext();
            _antiforgery = new AntiForgeryCookieService(httpContextAccessor, base._serviceProvider.GetRequiredService <IAntiforgery>(), base._serviceProvider.GetRequiredService <IOptions <AntiforgeryOptions> >()); // base._serviceProvider.GetRequiredService<IAntiForgeryCookieService>();

            _logger = base._serviceProvider.GetRequiredService <ILogger <AuthController> >();

            _controller = new AuthController(_usersService, _tokenStoreService, _tokenFactoryService, _uow, _antiforgery, _logger);
        }
Exemplo n.º 15
0
 public LesterRegistrationController(
     ILesterRegistrationService lesterRegistration,
     IUserService userService,
     IAntiForgeryCookieService antiForgery,
     IPermissionService permissionService,
     ITokenStoreService tokenStoreService,
     ITokenFactoryService tokenFactoryService,
     IWorkContext workContext)
 {
     _lesterRegistration  = lesterRegistration;
     _userService         = userService;
     _permissionService   = permissionService;
     _tokenStoreService   = tokenStoreService;
     _tokenFactoryService = tokenFactoryService;
     _antiforgery         = antiForgery;
     _workContext         = workContext;
 }
        public SecurityController(
            IUserService userService,
            ITokenStoreService tokenStoreService,
            ITokenFactoryService tokenFactoryService,
            IAntiForgeryCookieService antiforgery)
        {
            _userService = userService;
            _userService.CheckArgumentIsNull(nameof(userService));

            _tokenStoreService = tokenStoreService;
            _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));

            _antiforgery = antiforgery;
            _antiforgery.CheckArgumentIsNull(nameof(antiforgery));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 17
0
        public AuthController(IUsersService usersService, ITokenStoreService tokenStoreService, ITokenFactoryService tokenFactoryService, IUnitOfWork uow, IAntiForgeryCookieService antiforgery, ILogger <AuthController> logger)
        {
            _usersService = usersService;
            _usersService.CheckArgumentIsNull(nameof(usersService));

            _tokenStoreService = tokenStoreService;
            _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _antiforgery = antiforgery;
            _antiforgery.CheckArgumentIsNull(nameof(antiforgery));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));

            _logger = logger;
        }
Exemplo n.º 18
0
        public AccountsController(
            IUserService usersService,
            ITokenStoreService tokenStoreService,
            ITokenFactoryService tokenFactoryService,
            IAuthenticationUnitOfWork uow,
            IAntiForgeryCookieService antiforgery)
        {
            _usersService = usersService;
            _usersService.CheckArgumentIsNull(nameof(usersService));

            _tokenStoreService = tokenStoreService;
            _tokenStoreService.CheckArgumentIsNull(nameof(tokenStoreService));

            _uow = uow;
            _uow.CheckArgumentIsNull(nameof(_uow));

            _antiforgery = antiforgery;
            _antiforgery.CheckArgumentIsNull(nameof(antiforgery));

            _tokenFactoryService = tokenFactoryService;
            _tokenFactoryService.CheckArgumentIsNull(nameof(tokenFactoryService));
        }
Exemplo n.º 19
0
 public CustomerController(ICustomerService customerService,
                           ICustomerRegistrationService customerRegistrationService,
                           IEventPublisher eventPublisher,
                           ILocalizationService localizationService,
                           IWorkContext workContext,
                           IGenericAttributeService genericAttributeService,
                           IWorkflowMessageService workflowMessageService,
                           ITokenStoreService tokenStoreService,
                           ITokenFactoryService tokenFactoryService,
                           CustomerSettings customerSettings,
                           IAuthenticationService authenticationService)
 {
     _customerService             = customerService;
     _customerRegistrationService = customerRegistrationService;
     _eventPublisher          = eventPublisher;
     _localizationService     = localizationService;
     _workContext             = workContext;
     _genericAttributeService = genericAttributeService;
     _workflowMessageService  = workflowMessageService;
     _tokenStoreService       = tokenStoreService;
     _tokenFactoryService     = tokenFactoryService;
     _customerSettings        = customerSettings;
     _authenticationService   = authenticationService;
 }
Exemplo n.º 20
0
 public Handler(UserManager <AppUser> userManager, ITokenFactoryService tokenFactoryService)
 {
     this._tokenFactoryService = tokenFactoryService;
     this._userManager         = userManager;
 }
Exemplo n.º 21
0
 public AuthController(IUserService userService, ITokenFactoryService tokenFactoryService)
 {
     _userService         = userService;
     _tokenFactoryService = tokenFactoryService;
 }