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; }
public AuthController(DataContext context, IJwtService jwtService) { _jwtService = jwtService; _context = context; }
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"); } }
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; }
public AuthService(IJwtService jwtService) { _jwtService = jwtService; }
public AuthController(ILdapService ldap, IJwtService jwt, ILogger <AuthController> logger) { _ldap = ldap; _jwt = jwt; _logger = logger; }
public JwtTokenMiddleWare(IJwtService jwtService) { this.jwtService = jwtService; }
public AuthenticateUserHandler(IJwtService jwtService, IUserRepository repository) { _jwtService = jwtService; _repository = repository; }
public UserService(IJwtService jwtService, UserManager <User> userManager) { _jwtService = jwtService; _userManager = userManager; }
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; }
public ExpenseService(BudgetTrackerContext context, IJwtService jwtService) : base(context, jwtService) { }
public AccountController(IJwtService <ApplicationUser, UserLogin> jwt) { _jwt = jwt; }
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; }
public AccountController(ICommandDispatcher commandDispatcher, IJwtService jwtService) : base(commandDispatcher) { _jwtService = jwtService; }
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; }
public JwtServiceTest(WarmupInMemoryStore warmup) { _jwksService = warmup.Services.GetRequiredService <IJwtService>(); }
public CommentsController(ICommentService commentService, IJwtService jwtService) { _commentService = commentService; _jwtService = jwtService; }
public AuthenticationService(IJwtService jwtService, IUserService userService) { _jwtService = jwtService ?? throw new ArgumentNullException(nameof(jwtService)); _userService = userService ?? throw new ArgumentNullException(nameof(userService)); }
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; }
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; }
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; }
public PollTokenService(IJwtService jwtService, IUtcDateTimeProvider dateTimeProvider) { _JwtService = jwtService ?? throw new ArgumentNullException(nameof(jwtService)); _DateTimeProvider = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider)); }
public EagerLoadingController(DataBaseELContext dataBaseELContext, IJwtService jwtService) : base(dataBaseELContext, jwtService) { }