/// <summary> /// Validate a user's login credentials and retrieve their info with their roles /// </summary> /// <param name="auth"></param> /// <param name="model"></param> /// <param name="log"></param> public static Task <Maybe <AuthUserModel> > ValidateUserAsync(IAuthDataProvider auth, SignInModel model, ILog log) { log.Vrb("Validating credentials for {User}.", model.Email); return(from _ in auth.ValidateUserAsync <AuthUserModel>(model.Email, model.Password) from user in auth.RetrieveUserWithRolesAsync <AuthUserModel, AuthRoleModel>(model.Email) select user); }
public ScopedUserContext( IAuthApi authApi, IAuthDataProvider authData) { this._authApi = authApi; this._authData = authData; }
public CheckCase(IAppDbContext context, ILogger <SignInCase> logger, IAuthDataProvider dataProvider, ICurrentUserProvider currentUserProvider) { _context = context; _logger = logger; _dataProvider = dataProvider; _currentUserProvider = currentUserProvider; }
public AuthBasicValidationProvider( IAuthDataProvider _dataProvider, IAuthApi api) { this._dataProvider = _dataProvider; this.api = api; }
public SignInCase(IAppDbContext context, ILogger <SignInCase> logger, SignInManager <Entity.User> signInManager, IAuthDataProvider dataProvider) { _context = context; _logger = logger; _signInManager = signInManager; _dataProvider = dataProvider; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IAuthDataProvider authDataProvider, ILogger <Startup> logger, IHostApplicationLifetime hostApplicationLifetime) { logger.LogInformation($"Connection string: {Configuration.GetConnectionString("SQLServer")}"); authDataProvider.ApplyChanges(); app.RegisterWithConsul(hostApplicationLifetime); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseSwaggerWithUI(Configuration["ApiInfo:Name"], Configuration["ApiInfo:Version"]); app.UsePrometheusMetric(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); }
public SignUpCase(IAppDbContext context, ILogger <SignUpCase> logger, UserManager <Entity.User> userManager, IAuthDataProvider dataProvider, IFileUploader fileUploader, Microsoft.Extensions.Configuration.IConfiguration configuration1) { _context = context; _logger = logger; _userManager = userManager; _dataProvider = dataProvider; _fileUploader = fileUploader; _configuration = configuration1; }
/// <summary> /// Update the last sign in for a user /// </summary> /// <param name="auth"></param> /// <param name="user"></param> /// <param name="log"></param> public static Task <Maybe <bool> > UpdateUserLastSignInAsync(IAuthDataProvider auth, AuthUserId user, ILog log) { log.Vrb("Updating last sign in for user {UserId}.", user.Value); return(auth.User.UpdateLastSignInAsync(user) .AuditAsync(none: log.Msg) .SwitchAsync( some: x => F.Some(x), none: false )); }
public HarvestRestClient(IAuthDataProvider authDataProvider) { var refitSettings = new RefitSettings { JsonSerializerSettings = new JsonSerializerSettings { ContractResolver = new SnakeCaseContractResolver() } }; HttpMessageHandler clientHandler = new AuthenticatedHttpClientHandler(authDataProvider); #if DEBUG clientHandler = new HttpLoggingHandler(clientHandler); #endif var httpClient = new HttpClient(clientHandler) { BaseAddress = new Uri("https://api.harvestapp.com"), DefaultRequestHeaders = { UserAgent = { new ProductInfoHeaderValue("harvest.net.fork", Assembly.GetExecutingAssembly().GetName().Version.ToString()) } } }; var tokenHttpClient = new HttpClient(clientHandler) { BaseAddress = new Uri("https://id.getharvest.com"), DefaultRequestHeaders = { UserAgent = { new ProductInfoHeaderValue("harvest.net.fork", Assembly.GetExecutingAssembly().GetName().Version.ToString()) } } }; _tokenHttpClient = tokenHttpClient; _httpClient = httpClient; //_httpClient.DefaultRequestHeaders.Add("Harvest-Account-Id", accountId.ToString()); Companies = RestService.For <ICompanyApi>(_httpClient, refitSettings); Clients = RestService.For <IClientApi>(_httpClient, refitSettings); Tasks = RestService.For <ITaskApi>(_httpClient, refitSettings); Timesheets = RestService.For <ITimesheetsApi>(_httpClient, refitSettings); Projects = RestService.For <IProjectsApi>(_httpClient, refitSettings); TaskAssignments = RestService.For <ITaskAssignmentsApi>(_httpClient, refitSettings); UserAssignments = RestService.For <IUserAssignmentsApi>(_httpClient, refitSettings); Token = RestService.For <IToken>(_tokenHttpClient, refitSettings); Account = RestService.For <IAccountsApi>(_tokenHttpClient, refitSettings); }
public AccountController( IAuthLoginProvider _IAuthLoginService, IUserLoginService _login, IAuthApi _authApi, IAuthDataProvider _dataProvider, ICacheProvider _cache) { this._IAuthLoginService = _IAuthLoginService; this._login = _login; this._authApi = _authApi; this._dataProvider = _dataProvider; this._cache = _cache; }
public AccountController( IAuthLoginService _IAuthLoginService, IAuthTokenService _IAuthTokenService, LoginStatus logincontext, IEFRepository <AuthScope> _AuthScopeRepo, IEFRepository <LoginErrorLogEntity> _LogErrorRepo, IAuthDataProvider _IValidationDataProvider, ICacheProvider _cache) { this._IAuthLoginService = _IAuthLoginService; this._IAuthTokenService = _IAuthTokenService; this._LoginStatus = logincontext; this._AuthScopeRepo = _AuthScopeRepo; this._LogErrorRepo = _LogErrorRepo; this._IValidationDataProvider = _IValidationDataProvider; this._cache = _cache; }
public ConnectController( IAuthDataProvider _IValidationDataProvider, IAuthLoginService _IAuthLoginService, IAuthTokenService _IAuthTokenService, IAuthScopeService _IAuthScopeService, IAuthClientService _IAuthClientService, IRepository <AuthScope> _AuthScopeRepository, IRepository <AuthClient> _AuthClientRepository) { this._IValidationDataProvider = _IValidationDataProvider; this._IAuthLoginService = _IAuthLoginService; this._IAuthTokenService = _IAuthTokenService; this._IAuthScopeService = _IAuthScopeService; this._IAuthClientService = _IAuthClientService; this._AuthScopeRepository = _AuthScopeRepository; this._AuthClientRepository = _AuthClientRepository; }
public AccountController( IAuthLoginService _IAuthLoginService, IUserService user, ILoginLogService loginlog, LoginStatus logincontext, IRepository <AuthScope> _AuthScopeRepository, IAuthTokenService _IAuthTokenService, IAuthDataProvider _IValidationDataProvider, ICacheProvider _cache) { this._IAuthLoginService = _IAuthLoginService; this._IUserService = user; this._LoginErrorLogBll = loginlog; this._LoginStatus = logincontext; this._AuthScopeRepository = _AuthScopeRepository; this._IAuthTokenService = _IAuthTokenService; this._IValidationDataProvider = _IValidationDataProvider; this._cache = _cache; }
public AuthManageController( IAuthDataProvider _IValidationDataProvider, IAuthLoginService _IAuthLoginService, IAuthTokenService _IAuthTokenService, IAuthScopeService _IAuthScopeService, IAuthClientService _IAuthClientService, IEFRepository <AuthScope> _AuthScopeRepository, IEFRepository <AuthClient> _AuthClientRepository, IEFRepository <ReqLogEntity> _ReqLogModelRepository, IEFRepository <CacheHitLogEntity> _CacheHitLogRepository, ICacheProvider _cache) { this._IValidationDataProvider = _IValidationDataProvider; this._IAuthLoginService = _IAuthLoginService; this._IAuthTokenService = _IAuthTokenService; this._IAuthScopeService = _IAuthScopeService; this._IAuthClientService = _IAuthClientService; this._AuthScopeRepository = _AuthScopeRepository; this._AuthClientRepository = _AuthClientRepository; this._ReqLogModelRepository = _ReqLogModelRepository; this._CacheHitLogRepository = _CacheHitLogRepository; this._cache = _cache; }
public AuthControllerDataConnector() { _dataProvider = DataProviderFactory.GetAuthDataProvider(); }
public RouteGuardAuthProvider(IAuthDataProvider <RouteGuardAuthData> authProvider, IBaseHttpClient <AuthResponseModel> httpClient) { this.httpClient = httpClient; authData = authProvider.GetAuthData(); }
public ApplicationUserStore() { _authDataProvider = DataProviderFactory.GetAuthDataProvider(); }
public RolesController(IAuthDataProvider authDataProvider, IMapperService mapperService) { this.authDataProvider = authDataProvider; this.mapperService = mapperService; }
public UsersController(IAuthDataProvider db, IMapperService mapperService, ILogger <UsersController> logger) { this.db = db; this.mapperService = mapperService; this.logger = logger; }
public AuthService(IAuthDataProvider authDataProvider, ICryptService cryptService, ITokenService tokenService) { this.authDataProvider = authDataProvider; this.cryptService = cryptService; this.tokenService = tokenService; }
public ApplicationRoleStore() { _dataProvider = DataProviderFactory.GetAuthDataProvider(); }
public AuthenticatedHttpClientHandler(IAuthDataProvider provider) { _provider = provider ?? throw new ArgumentNullException(nameof(provider)); }
public UserController(IUserService userService, IMapperService mapperService, IAuthDataProvider authDataProvider) { this.userService = userService; this.mapperService = mapperService; this.authDataProvider = authDataProvider; }
public SignInModel(IAuthDataProvider auth, IAuthJwtProvider jwt, IOptions <AuthConfig> config, ILog <SignInModel> log) : base(auth, jwt, config, log) { }
public UserService(IAuthDataProvider authDataProvider, ITokenService tokenService) { this.authDataProvider = authDataProvider; this.tokenService = tokenService; }