public CreateUserCommandHandler(DatabaseContext context, IMapper mapper, IEncrypter encrypter, IJwtService jwtService, IMemoryCache cache)
 {
     this.context    = context;
     this.mapper     = mapper;
     this.encrypter  = encrypter;
     this.jwtService = jwtService;
     this.cache      = cache;
 }
Exemplo n.º 2
0
 public AuthController(DataContext context, IJwtService jwtService)
 {
     _jwtService = jwtService;
     _context    = context;
 }
Exemplo n.º 3
0
 private void attachUserToContext(HttpContext context, string token, IUserService userRepo, IAdminService adminRepo, IJwtService jwtService)
 {
     try
     {
         jwtService.ValidRefreshToken(token);
         JwtSecurityTokenHandler tokenHandler = new JwtSecurityTokenHandler();
         JwtSecurityToken        jwtToken     = tokenHandler.ReadToken(token) as JwtSecurityToken;
         int id   = jwtService.GetId(token);
         var user = userRepo.getInfoById(id);
         context.Items["IsAdmin"]  = user.IsAdmin == true?1:0;
         context.Items["TokenExp"] = false;
     }
     catch (SecurityTokenExpiredException err)
     {
         context.Items["TokenExp"] = true;
         context.Items["IsAdmin"]  = 0;
         Console.WriteLine(err.Message + " 1");
     }
     catch (Exception err)
     {
         context.Items["TokenExp"] = true;
         context.Items["IsAdmin"]  = 0;
         Console.WriteLine(err.Message + " 2");
     }
 }
Exemplo n.º 4
0
 public AuthController(IJwtService jwtService, IAppUserService appUserService, IMapper mapper)
 {
     _mapper         = mapper;
     _jwtService     = jwtService;
     _appUserService = appUserService;
 }
 public AccountController(IUserService userService, IJwtService jwtService)
 {
     _userService = userService;
     _jwtService  = jwtService;
 }
 public LoginAppService(IClienteAppService clienteAppService, IJwtService jwtService)
 {
     _clienteAppService = clienteAppService;
     _jwtService        = jwtService;
 }
Exemplo n.º 7
0
 public AuthService(IJwtService jwtService)
 {
     _jwtService = jwtService;
 }
Exemplo n.º 8
0
 public AuthController(ILdapService ldap, IJwtService jwt, ILogger <AuthController> logger)
 {
     _ldap   = ldap;
     _jwt    = jwt;
     _logger = logger;
 }
Exemplo n.º 9
0
 public JwtTokenMiddleWare(IJwtService jwtService)
 {
     this.jwtService = jwtService;
 }
Exemplo n.º 10
0
 public AuthenticateUserHandler(IJwtService jwtService, IUserRepository repository)
 {
     _jwtService = jwtService;
     _repository = repository;
 }
Exemplo n.º 11
0
 public UserService(IJwtService jwtService, UserManager <User> userManager)
 {
     _jwtService  = jwtService;
     _userManager = userManager;
 }
Exemplo n.º 12
0
 public UserController(IUserRepository userRepository, ILogger <UserController> logger, IJwtService jwtService,
                       UserManager <User> userManager, RoleManager <Role> roleManager, SignInManager <User> signInManager, IMapper mapper)
 {
     _userRepository = userRepository;
     _logger         = logger;
     _jwtService     = jwtService;
     _userManager    = userManager;
     _roleManager    = roleManager;
     _signInManager  = signInManager;
     _mapper         = mapper;
 }
Exemplo n.º 13
0
 public ExpenseService(BudgetTrackerContext context, IJwtService jwtService) : base(context, jwtService)
 {
 }
Exemplo n.º 14
0
 public AccountController(IJwtService <ApplicationUser, UserLogin> jwt)
 {
     _jwt = jwt;
 }
Exemplo n.º 15
0
 public AuthController(Repository repo, IJwtService jwt, ILogger <AuthController> logger)
 {
     _repo   = repo;
     _jwt    = jwt;
     _logger = logger;
 }
 public RegisterConnectionCommandHandler(IJwtService jwtService, IDynamoDbClient dynamoDbClient)
 {
     _jwtService     = jwtService;
     _dynamoDbClient = dynamoDbClient;
 }
Exemplo n.º 17
0
 public AccountController(ICommandDispatcher commandDispatcher, IJwtService jwtService)
     : base(commandDispatcher)
 {
     _jwtService = jwtService;
 }
Exemplo n.º 18
0
 public LoginController(IJwtService jwtService)
 {
     _jwtService = jwtService;
 }
 public void Teardown()
 {
     this.jwtService = null;
     this.mapper     = null;
 }
 public AccountService(UserManager <IdentityUser> userManager, IJwtService jwtService)
 {
     _userManager = userManager;
     _jwtService  = jwtService;
 }
Exemplo n.º 21
0
 public JwtServiceTest(WarmupInMemoryStore warmup)
 {
     _jwksService = warmup.Services.GetRequiredService <IJwtService>();
 }
 public CommentsController(ICommentService commentService, IJwtService jwtService)
 {
     _commentService = commentService;
     _jwtService     = jwtService;
 }
Exemplo n.º 23
0
 public AuthenticationService(IJwtService jwtService, IUserService userService)
 {
     _jwtService  = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _userService = userService ?? throw new ArgumentNullException(nameof(userService));
 }
Exemplo n.º 24
0
 public Handler(IJwtService <ApplicationUser, string, RefreshToken> jwtService,
                IXNewsIdentityDbContextSimplified identityDbContext)
 {
     _jwtService        = jwtService;
     _identityDbContext = identityDbContext;
 }
 public AlunoController(IUsuarioRepository usuarioRepository, IJwtService jwtService)
 {
     this.usuarioRepository = usuarioRepository;
     this.jwtService        = jwtService;
 }
Exemplo n.º 26
0
 public AuthService(ApiSettings apiSettings, UserManager <AuthUser> userManager, IEmailService emailSService, IJwtService jwtService, IGuidService guidService)
 {
     this.apiSettings  = apiSettings;
     this.userManager  = userManager;
     this.emailService = emailSService;
     this.jwtService   = jwtService;
     this.guidService  = guidService;
 }
Exemplo n.º 27
0
 public async Task Invoke(HttpContext context, IUserService userService, IAdminService adminService, IJwtService jwtService)
 {
     try{
         var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last();
         if (token != null)
         {
             attachUserToContext(context, token, userService, adminService, jwtService);
         }
         await _next(context);
     }catch (Exception e) {
         Console.WriteLine(e.Message);
     }
 }
 public VideoController(IVideoService videoService, IJwtService jwtService)
 {
     this.videoService = videoService;
     this.jwtService   = jwtService;
 }
Exemplo n.º 29
0
 public PollTokenService(IJwtService jwtService, IUtcDateTimeProvider dateTimeProvider)
 {
     _JwtService       = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _DateTimeProvider = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
 }
Exemplo n.º 30
0
 public EagerLoadingController(DataBaseELContext dataBaseELContext, IJwtService jwtService) : base(dataBaseELContext, jwtService)
 {
 }