Пример #1
0
 public UserLogic(IJWTFactory jwtFactory, IUnitOfWork unitOfWork, IPasswordHasher passwordHasher, IEmailService emailService)
 {
     _jwtFactory     = jwtFactory;
     _repositories   = unitOfWork;
     _passwordHasher = passwordHasher;
     _emailService   = emailService;
 }
Пример #2
0
 public AuthController(IUserService userService, UserManager <AppUser> userManager, IJWTFactory jwtFactory, IOptions <JwtIssuerOptions> jwtOptions)
 {
     _userService = userService;
     _userManager = userManager;
     _jwtFactory  = jwtFactory;
     _jwtOptions  = jwtOptions.Value;
 }
Пример #3
0
 public AuthController(IServiceProvider serviceProvider)
 {
     _userRepository = serviceProvider.GetService <IUserRepository>();
     _jwtFactory     = serviceProvider.GetService <IJWTFactory>();
     _tokenFactory   = serviceProvider.GetService <ITokenFactory>();
     _logger         = serviceProvider.GetService <ILogger>();
 }
Пример #4
0
 public SysUserAuthentication(IHttpContextAccessor httpContextAccessor,
                              SysUserJwtService sysUserJwtService,
                              IJWTFactory jwtFactory)
 {
     _jwtFactory          = jwtFactory;
     _sysUserJwtService   = sysUserJwtService;
     _httpContextAccessor = httpContextAccessor;
 }
 public AccountController(UserManager <UniversityUserModel> userManager, IJWTFactory jwtFactory,
                          IOptions <JWTIssuerOptions> jwtOptions, BLLUnitOfWork bll, IConfigurationRoot config)
 {
     _userManager = userManager;
     _jwtFactory  = jwtFactory;
     _jwtOptions  = jwtOptions.Value;
     _bll         = bll;
     _config      = config;
 }
Пример #6
0
        public static async Task <string> GenerateJwt(ClaimsIdentity identity, IJWTFactory jwtFactory, string userName, JwtIssuerOptions jwtOptions, JsonSerializerSettings serializerSettings)
        {
            var response = new
            {
                id         = identity.Claims.Single(c => c.Type == "id").Value,
                auth_token = await jwtFactory.GenerateEncodedToken(userName, identity),
                expires_in = (int)jwtOptions.ValidFor.TotalSeconds
            };

            return(JsonConvert.SerializeObject(response, serializerSettings));
        }
Пример #7
0
 public UserService(IJWTFactory jWTFactory, IUnitOfWork unitOfWork, IMapper mapper)
 {
     _jWTFactory = jWTFactory;
     _unitOfWork = unitOfWork;
     _mapper     = mapper;
 }
Пример #8
0
 public AccountsController(IAccountManager accountManager, ILoggerFactory logger, IJWTFactory jwtFactory)
 {
     this.logger         = logger.CreateLogger <AccountsController>();
     this.accountManager = accountManager;
     this.jwtFactory     = jwtFactory;
 }
Пример #9
0
 public UserService(IUserRepository userRepository, IJWTFactory jwtFactory)
 {
     _userRepository = userRepository;
     _jwtFactory     = jwtFactory;
 }