예제 #1
0
 public TeacherController(IMapper mapper, IJwtManager jwtManager,
                          IUserRepository <TeachersModel, TeacherReadDto> userRepository)
 {
     _mapper         = mapper;
     _jwtManager     = jwtManager;
     _userRepository = userRepository;
 }
예제 #2
0
 public LoginUserCommandHandler(IUsersCommandService usersCommandService, IUsersQueryService usersQueryService, IJwtManager jwtManager, IMemoryCache cache)
 {
     _usersCommandService = usersCommandService;
     _usersQueryService   = usersQueryService;
     _jwtManager          = jwtManager;
     _cache = cache;
 }
예제 #3
0
 public AuthService(IUnitOfWork unitOfWork, IJwtManager jwtManager, IPasswordHasher passwordHasher)
 {
     this.jwtManager       = jwtManager;
     this.passwordHasher   = passwordHasher;
     this.usersRepository  = unitOfWork.Repository <User>();
     this.tokensRepository = unitOfWork.Repository <UserToken>();
 }
예제 #4
0
 public AccountController(UserManager <IdentityCustomModel> userManager, DataDbContext context, IJwtManager jwtManager, IOptions <JwtIssuerProps> jwtProps, IHttpContextAccessor httpContextAccessor)
 {
     _userManager   = userManager;
     _dataDbContext = context;
     _manager       = new Manager(_dataDbContext);
     _jwtManager    = jwtManager;
     _jwtProps      = jwtProps.Value;
 }
예제 #5
0
 public UsersController(IJwtManager jwtManager,
                        UserManager <ApplicationUser> userManager,
                        SignInManager <ApplicationUser> signInManager)
 {
     m_jwtManager    = jwtManager;
     m_userManager   = userManager;
     m_signInManager = signInManager;
 }
예제 #6
0
 public AccountService(
     IAccountRepository accountRepository,
     IRefreshTokenService refreshTokenService,
     IJwtManager jwtManager)
 {
     _accountRepository   = accountRepository;
     _refreshTokenService = refreshTokenService;
     _jwtManager          = jwtManager;
 }
예제 #7
0
 public GreetingSystemService(IVmsLogger <GreetingSystemService> logger, IPasswordManager passwordManager, IIdentityRepository identityRepository, IBusinessRepository businessRepository, IJwtManager jwtManager, IRefreshTokenService tokenService)
 {
     _logger             = logger;
     _passwordManager    = passwordManager;
     _identityRepository = identityRepository;
     _businessRepository = businessRepository;
     _jwtManager         = jwtManager;
     _tokenService       = tokenService;
 }
 public AuthenticationService(
     IHttpContextAccessor httpContextAccessor,
     IJwtManager jwtManager,
     IUserManager userManager)
 {
     this.httpContextAccessor = httpContextAccessor;
     this.jwtManager          = jwtManager;
     this.userManager         = userManager;
 }
예제 #9
0
 public LoginRequestHandler(
     IMapper mapper,
     IRepository <User> userRepo,
     IJwtManager jwtManager)
 {
     this.mapper     = mapper;
     this.userRepo   = userRepo;
     this.jwtManager = jwtManager;
 }
예제 #10
0
            public static async Task <Jwt> GenerateJwt(ClaimsIdentity identity, IJwtManager jwtManager, string email /*aka userName in IdentityCustomModel*/, JwtIssuerProps jwtProps)
            {
                var jwt = new Jwt
                {
                    id         = identity.Claims.Single(i => i.Type == JwtClaimHelper.ClaimIdentifierId).Value,
                    auth_token = await jwtManager.GenerateEncodedToken(email, identity),
                    expires_in = (int)jwtProps.ValidFor.TotalSeconds
                };

                return(jwt);
            }
예제 #11
0
 public AccountController(IUnitOfWork unitOfWork, UserManager <User> userManager, RoleManager <IdentityRole> roleManager, SignInManager <User> signInManager, IJwtManager jwtManager, IEmailService emailService, IConfiguration configuration, IAntiforgery antiforgery)
 {
     _unitOfWork    = unitOfWork;
     _userManager   = userManager;
     _roleManager   = roleManager;
     _signInManager = signInManager;
     _jwtManager    = jwtManager;
     _emailService  = emailService;
     _configuration = configuration;
     _antiforgery   = antiforgery;
 }
예제 #12
0
 protected ExecutorBase(IWorkspaceRepository workspaceRepository, IResourceCatalog resourceCatalog, ITestCatalog testCatalog, ITestCoverageCatalog testCoverageCatalog, IAuthorizationService authorizationService, IDataObjectFactory dataObjectFactory, IEsbChannelFactory esbChannelFactory, IJwtManager jwtManager)
 {
     _repository           = workspaceRepository;
     _resourceCatalog      = resourceCatalog;
     _testCatalog          = testCatalog;
     _testCoverageCatalog  = testCoverageCatalog;
     _authorizationService = authorizationService;
     _dataObjectFactory    = dataObjectFactory;
     _esbChannelFactory    = esbChannelFactory;
     _jwtManager           = jwtManager;
 }
예제 #13
0
 public AuthenticationController(UserManager <User> userManager, IMapper mapper,
                                 ILogger <AuthenticationController> logger, IJwtManager jwtManager,
                                 IEmailSender emailSender, IWebHostEnvironment env)
 {
     this.userManager = userManager;
     this.mapper      = mapper;
     this.logger      = logger;
     this.jwtManager  = jwtManager;
     this.emailSender = emailSender;
     this.env         = env;
 }
예제 #14
0
 protected AbstractWebRequestHandler(IResourceCatalog resourceCatalog, ITestCatalog testCatalog, ITestCoverageCatalog testCoverageCatalog, IWorkspaceRepository workspaceRepository, IAuthorizationService authorizationService, IDataObjectFactory dataObjectFactory, IEsbChannelFactory esbChannelFactory, ISecuritySettings securitySettings, IJwtManager jwtManager)
 {
     _resourceCatalog      = resourceCatalog;
     _testCatalog          = testCatalog;
     _testCoverageCatalog  = testCoverageCatalog;
     _workspaceRepository  = workspaceRepository;
     _authorizationService = authorizationService;
     _dataObjectFactory    = dataObjectFactory;
     _esbChannelFactory    = esbChannelFactory;
     _securitySettings     = securitySettings;
     _jwtManager           = jwtManager;
 }
예제 #15
0
 public UserService(IPendingIdentityRepository pendingIdentityRepository, IIdentityRepository identityRepository, IVmsLogger <UserService> logger, IPasswordManager passwordManager, IServiceBusMessagePublisher publisher, IJwtManager jwtManager, IRefreshTokenService tokenService, IResetRequestFactory resetRequestFactory, IResetRequestRepository resetRequestRepository, IBusinessRepository businessRepository, INumberGenerator numberGenerator)
 {
     _pendingIdentityRepository = pendingIdentityRepository;
     _identityRepository        = identityRepository;
     _logger                 = logger;
     _passwordManager        = passwordManager;
     _publisher              = publisher;
     _jwtManager             = jwtManager;
     _tokenService           = tokenService;
     _resetRequestFactory    = resetRequestFactory;
     _resetRequestRepository = resetRequestRepository;
     _businessRepository     = businessRepository;
     _numberGenerator        = numberGenerator;
 }
예제 #16
0
 public AdminIdentityService(IServiceBusMessagePublisher serviceBus, IIdentityRepository identityRepository,
                             IPendingIdentityRepository pendingIdentityRepository, IPasswordManager passwordManager,
                             IJwtManager jwtManager, IVmsLogger <AdminIdentityService> logger, IRefreshTokenService tokenService,
                             IBusinessRepository businessRepository)
 {
     _serviceBus                = serviceBus;
     _identityRepository        = identityRepository;
     _pendingIdentityRepository = pendingIdentityRepository;
     _passwordManager           = passwordManager;
     _jwtManager                = jwtManager;
     _logger             = logger;
     _tokenService       = tokenService;
     _businessRepository = businessRepository;
 }
예제 #17
0
 public AuthService(IPasswordHasher hasher,
                    IMapper mapper,
                    IJwtManager jwtManager,
                    IUserRepository userRepository,
                    IRefreshtokenService refreshTokenService,
                    IFacebookAuthService facebookAuthService)
 {
     _facebookAuthService = facebookAuthService;
     _hasher              = hasher;
     _mapper              = mapper;
     _jwtManager          = jwtManager;
     _userRepository      = userRepository;
     _refreshTokenService = refreshTokenService;
 }
예제 #18
0
 public AuthenticationService(
     IUnitOfWork unitOfWork,
     EShopperUserManager eShopperUserManager,
     IJwtManager jwtManager,
     IMapper mapper,
     IEmailSender emailSender,
     ILogger <AuthenticationService> logger,
     RoleManager <IdentityRole> roleManager)
 {
     _unitOfWork          = unitOfWork;
     _eShopperUserManager = eShopperUserManager;
     _jwtManager          = jwtManager;
     _mapper      = mapper;
     _emailSender = emailSender;
     _logger      = logger;
     _roleManager = roleManager;
 }
예제 #19
0
 public UserService(
     IGenericUserRepository <User> userRepository,
     IGenericUserRepository <Admin> adminRepository,
     IGenericUserRepository <Registrar> registrarRepository,
     IGenericUserRepository <Doctor> doctorRepository,
     IGenericUserRepository <LabTechnician> labTechnicianRepository,
     IGenericUserRepository <LabManager> labManagerRepository,
     DataContext context,
     IJwtManager jwtManager, IRefreshTokenRepository refreshTokenRepository)
 {
     this.userRepository          = userRepository;
     this.adminRepository         = adminRepository;
     this.registrarRepository     = registrarRepository;
     this.doctorRepository        = doctorRepository;
     this.labTechnicianRepository = labTechnicianRepository;
     this.labManagerRepository    = labManagerRepository;
     this.context                = context;
     this.jwtManager             = jwtManager;
     this.refreshTokenRepository = refreshTokenRepository;
 }
예제 #20
0
        public async Task AuthenticateAsync(HttpAuthenticationContext context, CancellationToken cancellationToken)
        {
            var request       = context.Request;
            var ip            = GetClientIp(request);
            var authorization = request.Headers.Authorization;
            var requestScope  = context.Request.GetDependencyScope();

            // Resolve the service you want to use.
            JwtManager = requestScope.GetService(typeof(IJwtManager)) as IJwtManager;
            if (authorization == null)
            {
                context.ErrorResult = new AuthenticationFailureResult("Missing Authorization Value", request);
                return;
            }

            if (authorization.Scheme != "Bearer")
            {
                context.ErrorResult = new AuthenticationFailureResult("Wrong Authorization Scheme", request);
                return;
            }

            if (string.IsNullOrEmpty(authorization.Parameter))
            {
                context.ErrorResult = new AuthenticationFailureResult("Missing Jwt Token", request);
                return;
            }

            var token     = authorization.Parameter;
            var principal = await AuthenticateJwtToken(token);

            if (principal == null)
            {
                context.ErrorResult = new AuthenticationFailureResult("Invalid Token", request);
            }

            else
            {
                context.Principal = principal;
            }
        }
예제 #21
0
 public RecursoController(IRecursoAppService recursoAppService, IJwtManager jwtManager, ISystemConfiguration systemConfiguration)
 {
     _recursoAppService   = recursoAppService;
     _jwtManager          = jwtManager;
     _systemConfiguration = systemConfiguration;
 }
예제 #22
0
 public AuthService(ShopDbContext db, IMapper mapper, IJwtManager jwtManager)
 {
     _jwtManager = jwtManager;
     _db         = db;
     _mapper     = mapper;
 }
예제 #23
0
 public LoginController(IUnitOfWork unitOfWork, IJwtManager jwtManager, IPasswordHasher passwordHasher)
 {
     usersDomain = new UsersDomain(unitOfWork, jwtManager, passwordHasher);
 }
예제 #24
0
 public AuthController(IJwtManager jWTManager)
 {
     manager = jWTManager;
 }
 public AuthController(IJwtManager jwtManager) => _jwtManager = jwtManager;
예제 #26
0
 public HomeController(IJwtManager jwtTokenManager)
 {
     _jwtTokenManager = jwtTokenManager;
 }
예제 #27
0
 public AuthorizationService(IRepository <Admin> adminRepository, IPasswordEncoder passwordEncoder, IJwtManager jwtManager)
 {
     _adminRepository = adminRepository;
     _passwordEncoder = passwordEncoder;
     _jwtManager      = jwtManager;
 }
예제 #28
0
 public CustomJwtBearerEvents(IJwtManager jwtManager, IUnitOfWork unitOfWork)
 {
     this.jwtManager       = jwtManager;
     this.tokensRepository = unitOfWork.Repository <UserToken>();
 }
예제 #29
0
 public TokenController(IJwtManager jwtManager)
 {
     _jwtManager = jwtManager;
 }
예제 #30
0
 public AuthController(IJwtManager jwtManager, IUserManager userManager)
 {
     _jwtManager  = jwtManager;
     _userManager = userManager;
 }