コード例 #1
0
 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;
 }
コード例 #2
0
 public AuthController(DataContext context, IJwtService jwtService)
 {
     _jwtService = jwtService;
     _context    = context;
 }
コード例 #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");
     }
 }
コード例 #4
0
ファイル: AuthController.cs プロジェクト: emreyk/Jwt-WebApi
 public AuthController(IJwtService jwtService, IAppUserService appUserService, IMapper mapper)
 {
     _mapper         = mapper;
     _jwtService     = jwtService;
     _appUserService = appUserService;
 }
コード例 #5
0
 public AccountController(IUserService userService, IJwtService jwtService)
 {
     _userService = userService;
     _jwtService  = jwtService;
 }
コード例 #6
0
 public LoginAppService(IClienteAppService clienteAppService, IJwtService jwtService)
 {
     _clienteAppService = clienteAppService;
     _jwtService        = jwtService;
 }
コード例 #7
0
ファイル: AuthService.cs プロジェクト: lijinbao11/JWTDemo
 public AuthService(IJwtService jwtService)
 {
     _jwtService = jwtService;
 }
コード例 #8
0
 public AuthController(ILdapService ldap, IJwtService jwt, ILogger <AuthController> logger)
 {
     _ldap   = ldap;
     _jwt    = jwt;
     _logger = logger;
 }
コード例 #9
0
 public JwtTokenMiddleWare(IJwtService jwtService)
 {
     this.jwtService = jwtService;
 }
コード例 #10
0
 public AuthenticateUserHandler(IJwtService jwtService, IUserRepository repository)
 {
     _jwtService = jwtService;
     _repository = repository;
 }
コード例 #11
0
 public UserService(IJwtService jwtService, UserManager <User> userManager)
 {
     _jwtService  = jwtService;
     _userManager = userManager;
 }
コード例 #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;
 }
コード例 #13
0
 public ExpenseService(BudgetTrackerContext context, IJwtService jwtService) : base(context, jwtService)
 {
 }
コード例 #14
0
 public AccountController(IJwtService <ApplicationUser, UserLogin> jwt)
 {
     _jwt = jwt;
 }
コード例 #15
0
ファイル: AuthController.cs プロジェクト: BITICPC/BitWaves
 public AuthController(Repository repo, IJwtService jwt, ILogger <AuthController> logger)
 {
     _repo   = repo;
     _jwt    = jwt;
     _logger = logger;
 }
コード例 #16
0
 public RegisterConnectionCommandHandler(IJwtService jwtService, IDynamoDbClient dynamoDbClient)
 {
     _jwtService     = jwtService;
     _dynamoDbClient = dynamoDbClient;
 }
コード例 #17
0
 public AccountController(ICommandDispatcher commandDispatcher, IJwtService jwtService)
     : base(commandDispatcher)
 {
     _jwtService = jwtService;
 }
コード例 #18
0
ファイル: LoginController.cs プロジェクト: wenicaicai/TryJwt
 public LoginController(IJwtService jwtService)
 {
     _jwtService = jwtService;
 }
コード例 #19
0
 public void Teardown()
 {
     this.jwtService = null;
     this.mapper     = null;
 }
コード例 #20
0
 public AccountService(UserManager <IdentityUser> userManager, IJwtService jwtService)
 {
     _userManager = userManager;
     _jwtService  = jwtService;
 }
コード例 #21
0
 public JwtServiceTest(WarmupInMemoryStore warmup)
 {
     _jwksService = warmup.Services.GetRequiredService <IJwtService>();
 }
コード例 #22
0
 public CommentsController(ICommentService commentService, IJwtService jwtService)
 {
     _commentService = commentService;
     _jwtService     = jwtService;
 }
コード例 #23
0
 public AuthenticationService(IJwtService jwtService, IUserService userService)
 {
     _jwtService  = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _userService = userService ?? throw new ArgumentNullException(nameof(userService));
 }
コード例 #24
0
 public Handler(IJwtService <ApplicationUser, string, RefreshToken> jwtService,
                IXNewsIdentityDbContextSimplified identityDbContext)
 {
     _jwtService        = jwtService;
     _identityDbContext = identityDbContext;
 }
コード例 #25
0
 public AlunoController(IUsuarioRepository usuarioRepository, IJwtService jwtService)
 {
     this.usuarioRepository = usuarioRepository;
     this.jwtService        = jwtService;
 }
コード例 #26
0
ファイル: Includes.cs プロジェクト: codenesium/samples
 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;
 }
コード例 #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);
     }
 }
コード例 #28
0
 public VideoController(IVideoService videoService, IJwtService jwtService)
 {
     this.videoService = videoService;
     this.jwtService   = jwtService;
 }
コード例 #29
0
 public PollTokenService(IJwtService jwtService, IUtcDateTimeProvider dateTimeProvider)
 {
     _JwtService       = jwtService ?? throw new ArgumentNullException(nameof(jwtService));
     _DateTimeProvider = dateTimeProvider ?? throw new ArgumentNullException(nameof(dateTimeProvider));
 }
コード例 #30
0
 public EagerLoadingController(DataBaseELContext dataBaseELContext, IJwtService jwtService) : base(dataBaseELContext, jwtService)
 {
 }