Пример #1
0
 public RegisterCommandHandler(
     IUserRepository userRepository,
     IJwtAuthenticationService authenticationTokenService)
 {
     this.userRepository             = userRepository;
     this.authenticationTokenService = authenticationTokenService;
 }
Пример #2
0
 public async Task Invoke(HttpContext context, IJwtAuthenticationService authenticateService)
 {
     if (!IsNullOrWhiteSpace(authenticateService
                             .CheckTokenValidate(context.Session.GetString("Token"))))
     {
         var currentUser     = context.Session.Get <User>("CurrentUser");
         var userPermissions = ApiExtension.PostAsync <IEnumerable <Permission>, RequestParameters>(
             GlobalParameter.ApiBaseAddress,
             "/api/User/GetUserAllPermissions", new RequestParameters
         {
             Param1 = currentUser.Id,
             Param2 = currentUser.SoftwareId,
         },
             context.Session.GetString("Token")).Result;
         if (userPermissions.All(p => !string.Equals(p.Action, context.Request.Path.ToString(), StringComparison.CurrentCultureIgnoreCase)))
         {
             context.Response.Redirect($"{context.Request.Scheme}://" +
                                       $"{context.Request.Host}/Identity/User/Profile");
         }
         await _next.Invoke(context);
     }
     else
     {
         context.Response.Redirect($"{context.Request.Scheme}://{context.Request.Host}/Home/Login");
     }
 }
Пример #3
0
 public CustomerController(IPersonService personService, IBookService bookService,
                           IJwtAuthenticationService jwtAuthenticationService,
                           IMapper mapper)
 {
     this.personService            = personService;
     this.bookService              = bookService;
     this.jwtAuthenticationService = jwtAuthenticationService;
     this.mapper = mapper;
 }
Пример #4
0
 public async Task Invoke(HttpContext context, IJwtAuthenticationService authenticateService)
 {
     if (!string.IsNullOrWhiteSpace(authenticateService
                                    .CheckTokenValidate(context.Request.Headers["Security-Token"])))
     {
         await _next.Invoke(context);
     }
     else
     {
         context.Response.Redirect($"{context.Request.Scheme}://{context.Request.Host}/Home/Login");
     }
 }
Пример #5
0
 public AccountService(
     UserManager <DomainModel.User> userManager,
     SignInManager <DomainModel.User> signInManager,
     IJwtAuthenticationService jwtAuthenticationService,
     IEmailService emailService,
     IdentityErrorDescriber errorDescriber,
     IConfiguration configuration,
     IMediator mediator)
 {
     this.userManager              = userManager;
     this.signInManager            = signInManager;
     this.jwtAuthenticationService = jwtAuthenticationService;
     this.emailService             = emailService;
     this.errorDescriber           = errorDescriber;
     this.configuration            = configuration;
     this.mediator = mediator;
 }
Пример #6
0
 public AccountsController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IJwtAuthenticationService authenticationService)
 {
     this.userManager           = userManager;
     this.signInManager         = signInManager;
     this.authenticationService = authenticationService;
 }
Пример #7
0
 public AuthController(IJwtAuthenticationService _JwtAuthenticationService, IMailService _MailService)
 {
     JwtAuthenticationService = _JwtAuthenticationService;
     MailService = _MailService;
 }
 public CalculosController(ILogger <CalculosController> logger, IJwtAuthenticationService authService)
 {
     _logger      = logger ?? throw new ArgumentNullException(nameof(logger));
     _authService = authService;
 }
Пример #9
0
 public AccountController(IJwtAuthenticationService jwtAuthenticationService)
 {
     this.jwtAuthenticationService = jwtAuthenticationService;
 }
Пример #10
0
 public AuthenticateController(IJwtAuthenticationService jwtAuthenticationManager)
 {
     m_jwtAuthenticationManager = jwtAuthenticationManager;
 }
Пример #11
0
 public AuthController(UserManager <ApplicationUser> userManager, IJwtAuthenticationService service, IJwtSecurityService jwtService)//IJwtTokenManager jwtTokenManager,
 {
     this.userManager = userManager;
     this.authService = service;
     this.jwtService  = jwtService;
 }
Пример #12
0
 public UserController(IJwtAuthenticationService jwtAuthenticationService)
 {
     _jwtAuthenticationService = jwtAuthenticationService;
 }