Exemplo n.º 1
0
 public RegisterCommandHandler(
     IUserRepository userRepository,
     IJwtAuthenticationService authenticationTokenService)
 {
     this.userRepository             = userRepository;
     this.authenticationTokenService = authenticationTokenService;
 }
Exemplo n.º 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");
     }
 }
Exemplo n.º 3
0
 public CustomerController(IPersonService personService, IBookService bookService,
                           IJwtAuthenticationService jwtAuthenticationService,
                           IMapper mapper)
 {
     this.personService            = personService;
     this.bookService              = bookService;
     this.jwtAuthenticationService = jwtAuthenticationService;
     this.mapper = mapper;
 }
Exemplo n.º 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");
     }
 }
Exemplo n.º 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;
 }
Exemplo n.º 6
0
 public AccountsController(UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IJwtAuthenticationService authenticationService)
 {
     this.userManager           = userManager;
     this.signInManager         = signInManager;
     this.authenticationService = authenticationService;
 }
Exemplo n.º 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;
 }
Exemplo n.º 9
0
 public AccountController(IJwtAuthenticationService jwtAuthenticationService)
 {
     this.jwtAuthenticationService = jwtAuthenticationService;
 }
Exemplo n.º 10
0
 public AuthenticateController(IJwtAuthenticationService jwtAuthenticationManager)
 {
     m_jwtAuthenticationManager = jwtAuthenticationManager;
 }
Exemplo n.º 11
0
 public AuthController(UserManager <ApplicationUser> userManager, IJwtAuthenticationService service, IJwtSecurityService jwtService)//IJwtTokenManager jwtTokenManager,
 {
     this.userManager = userManager;
     this.authService = service;
     this.jwtService  = jwtService;
 }
Exemplo n.º 12
0
 public UserController(IJwtAuthenticationService jwtAuthenticationService)
 {
     _jwtAuthenticationService = jwtAuthenticationService;
 }