public UsersController( UserManager <AppUser> userManager, IJwtTokenFactory jwtTokenFactory) { _userManager = userManager; _jwtTokenFactory = jwtTokenFactory; }
public JwtService( IConfiguration config, IJwtTokenFactory tokenFactory) { _config = config; _tokenFactory = tokenFactory; _tokenParams = new Lazy <TokenValidationParameters>(GetTokenParams, LazyThreadSafetyMode.ExecutionAndPublication); }
public UserProvider(IUserRepository userRepository, IJwtTokenFactory jwtFactory, ITokenFactory tokenFactory, IUserValidator userValidator, IErrorListProvider errorListProvider) { this.userRepository = userRepository; this.jwtFactory = jwtFactory; this.tokenFactory = tokenFactory; this.userValidator = userValidator; this.errorListProvider = errorListProvider; }
public AuthenticateService(IJwtTokenFactory tokenFactory, IGoogleTokenVerificationService googleTokenVerificationService, IMediator mediator) { this.tokenFactory = tokenFactory; this.googleTokenVerificationService = googleTokenVerificationService; this.mediator = mediator; }
public UserService(UserManager <AppUser> userManager, AppDbContext dbContext, ITokenFactory tokenFactory, IJwtTokenFactory jwtTokenFactory) { this.userManager = userManager; this.dbContext = dbContext; this.tokenFactory = tokenFactory; this.jwtTokenFactory = jwtTokenFactory; }
public AccountService(SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager, IJwtTokenFactory jwtTokenFactory, ApplicationDbContext context, RoleManager <IdentityRole> roleManager) { _signInManager = signInManager; _userManager = userManager; _jwtTokenFactory = jwtTokenFactory; _context = context; _roleManager = roleManager; }
public ClientCredentialsTokenGenerator( IAuthenticateClientService applicationService, IAccessTokenRepository accessTokenRepository, IJwtTokenFactory jwtTokenFactory) { _authenticateClientService = applicationService; _accessTokenRepository = accessTokenRepository; _jwtTokenFactory = jwtTokenFactory; }
public AuthService(UserManager <AppUser> userManager, AppDbContext dbContext, ITokenFactory tokenFactory, IJwtTokenFactory jwtTokenFactory, IJwtTokenValidator tokenValidator) { this.userManager = userManager; this.dbContext = dbContext; this.tokenFactory = tokenFactory; this.jwtTokenFactory = jwtTokenFactory; this.tokenValidator = tokenValidator; }
public LoginUserWithCredentialsCommandHandler( IAuthRepository authRepository, IJwtTokenFactory jwtTokenFactory, ITenantsRepository tenantsRepository, IMapper mapper) { _authRepository = authRepository; _jwtTokenFactory = jwtTokenFactory; _tenantsRepository = tenantsRepository; _mapper = mapper; }
/// <summary> /// Constructor /// </summary> /// <param name="signInManager">Identity singIn manager</param> /// <param name="userManager">Identity user manager</param> /// <param name="unitOfWork">Unit of work</param> /// <param name="jwtTokenFactory">Jwt token factory</param> public AuthenticationService( SignInManager <ApplicationUser> signInManager, UserManager <ApplicationUser> userManager, IUnitOfWork unitOfWork, IJwtTokenFactory jwtTokenFactory) { _signInManager = signInManager; _userManager = userManager; _unitOfWork = unitOfWork; _jwtTokenFactory = jwtTokenFactory; }
public static async Task <string> GenerateJwt(ClaimsIdentity identity, IJwtTokenFactory jwtFactory, string userName, JwtIssuerOptions jwtOptions, JsonSerializerSettings serializerSettings) { var response = new { id = identity.Claims.Single(c => c.Type == "id").Value, auth_token = await Task.FromResult(jwtFactory.GenerateEncodedToken(userName, identity)), expires_in = (int)TimeSpan.FromMinutes(1).TotalSeconds }; return(JsonConvert.SerializeObject(response, serializerSettings)); }
public AccountController( SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager, IJwtTokenFactory jwtTokenFactory, IAccountService accountService) { _jwtTokenFactory = jwtTokenFactory; _accountService = accountService; _signInManager = signInManager; _userManager = userManager; }
public TenantAuthenticateCommandHandler( IMapper mapper, ILogger <TenantAuthenticateCommandHandler> logger, IConfiguration appSettings, ITenantRepository tenantRepository, IHashing hashing, IJwtTokenFactory jwtTokenFactory ) : base(tenantRepository, mapper, logger) { _appSettings = appSettings; _hashing = hashing; _jwtTokenFactory = jwtTokenFactory; }
public AuthService( IJwtTokenValidator jwtTokenValidator, IAppUsersRepository appUsersRepository, IJwtTokenFactory jwtTokenFactory, ITokenFactory tokenFactory, ISettings settings) { _jwtTokenValidator = jwtTokenValidator ?? throw new ArgumentNullException(nameof(jwtTokenValidator)); _appUsersRepository = appUsersRepository ?? throw new ArgumentNullException(nameof(appUsersRepository)); _jwtTokenFactory = jwtTokenFactory ?? throw new ArgumentNullException(nameof(jwtTokenFactory)); _tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); }
public AccountsService( UserManager <IdentityUser> userManager, IAppUsersRepository appUsersRepository, ITokenFactory tokenFactory, IJwtTokenFactory jwtTokenFactory, ISettings settings) { _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager)); _appUsersRepository = appUsersRepository ?? throw new ArgumentNullException(nameof(appUsersRepository)); _tokenFactory = tokenFactory ?? throw new ArgumentNullException(nameof(tokenFactory)); _jwtTokenFactory = jwtTokenFactory ?? throw new ArgumentNullException(nameof(jwtTokenFactory)); _settings = settings ?? throw new ArgumentNullException(nameof(settings)); }
public RefreshTokenGenerator( IAuthenticateClientService applicationService, IRefreshTokenRepository refreshTokenRepository, IAccessTokenRepository accessTokenRepository, IJwtTokenFactory jwtTokenFactory, IPasswordGenerator passwordGenerator, OAuth2Settings settings) { _authenticateClientService = applicationService; _refreshTokenRepository = refreshTokenRepository; _accessTokenRepository = accessTokenRepository; _jwtTokenFactory = jwtTokenFactory; _passwordGenerator = passwordGenerator; _settings = settings; }
public AuthorizationCodeTokenGenerator( IAuthenticateClientService authenticateClientService, IFindApplicationService applicationService, IRefreshTokenGenerator refreshTokenGenerator, IAuthorizationCodeRepository authorizationCodeRepository, IAccessTokenRepository accessTokenRepository, IRefreshTokenRepository refreshTokenRepository, IJwtTokenFactory jwtTokenFactory) { _authenticateClientService = authenticateClientService; _findApplicationService = applicationService; _refreshTokenGenerator = refreshTokenGenerator; _authorizationCodeRepository = authorizationCodeRepository; _accessTokenRepository = accessTokenRepository; _refreshTokenRepository = refreshTokenRepository; _jwtTokenFactory = jwtTokenFactory; }
public AuthorizeUserWithFacebookCommandHandler( IFacebookApiClient facebookApiClient, ITenantProviderSettingsRepository providerSettingsRepository, ITenantsRepository tenantsRepository, IAuthRepository authRepository, IJwtTokenFactory jwtTokenFactory, IAvatarRepository avatarRepository, IGuid guid, IMapper mapper) { _facebookApiClient = facebookApiClient; _providerSettingsRepository = providerSettingsRepository; _tenantsRepository = tenantsRepository; _authRepository = authRepository; _jwtTokenFactory = jwtTokenFactory; _avatarRepository = avatarRepository; _guid = guid; _mapper = mapper; }
public GithubHttpClient(IJwtTokenFactory jwtHelper) { _client = new HttpClient(); _jwtHelper = jwtHelper; }
public IdentityService(UserManager <User> userManager, SignInManager <User> signInManager, IJwtTokenFactory jwtFactory) { _userManager = userManager; _signInManager = signInManager; _jwtFactory = jwtFactory; }
public ApiUserController(IJwtTokenFactory tokenFactory) { _tokenFactory = tokenFactory; }
public UsersController(UserManager <ApplicationUser> userManager, IJwtTokenFactory jwtFactory, IOptions <JwtIssuerOptions> jwtOptions) { _userManager = userManager; _jwtFactory = jwtFactory; _jwtOptions = jwtOptions.Value; }
public AccountsHandler(IUserRepository userRepository, IJwtTokenFactory jwtFactory, ILogger <AccountsHandler> logger) { _userRepository = userRepository; _jwtFactory = jwtFactory; _logger = logger; }
public async Task InvokeAsync(HttpContext context, IConfiguration configuration, IJwtTokenFactory jwtTokenFactory, IMediator mediator) { var endpoint = context.GetEndpoint(); if (endpoint?.Metadata?.GetMetadata <IAllowAnonymous>() is object) { await _next(context); return; } var hasAuthorization = context.Request.Headers.ContainsKey("Authorization"); if (hasAuthorization is false) { await _next(context); return; } var token = await context.GetTokenAsync("Bearer", "access_token"); var secret = configuration.GetValue <string>("Secret"); var jwtToken = jwtTokenFactory.ValidateToken(token, secret); var enterpriseName = jwtToken.Claims.FirstOrDefault(x => x.Type == CustomClaims.EnterpriseName)?.Value; if (string.IsNullOrWhiteSpace(enterpriseName) is false) { var query = new RetrieveConnectionStringByEnterpriseNameQuery() { EnterpriseName = enterpriseName }; var result = await mediator.Send(query); if (result.IsFailure) { context.Response.StatusCode = 400; await context.Response.WriteAsync(result.Value); } else { context.Items[HttpContextKeys.TenantConnectionString] = result.Value; } } await _next(context); }