public ServeService(IContactService contactService, IContactRelationshipService contactRelationshipService, IOpportunityService opportunityService, MinistryPlatform.Translation.Services.Interfaces.IEventService eventService, IParticipantService participantService, IGroupParticipantService groupParticipantService, IGroupService groupService, ICommunicationService communicationService, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper, IApiUserService apiUserService, IResponseService responseService) { _contactService = contactService; _contactRelationshipService = contactRelationshipService; _opportunityService = opportunityService; _eventService = eventService; _participantService = participantService; _groupParticipantService = groupParticipantService; _groupService = groupService; _communicationService = communicationService; _authenticationService = authenticationService; _configurationWrapper = configurationWrapper; _apiUserService = apiUserService; _responseService = responseService; }
private void attachUserToContext(HttpContext context, IApiUserService userService, string token) { try { var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.ASCII.GetBytes(_appSettings.Secret); tokenHandler.ValidateToken(token, new TokenValidationParameters { ValidateIssuerSigningKey = true, IssuerSigningKey = new SymmetricSecurityKey(key), ValidateIssuer = false, ValidateAudience = false, // set clockskew to zero so tokens expire exactly at token expiration time (instead of 5 minutes later) ClockSkew = TimeSpan.Zero }, out SecurityToken validatedToken); var jwtToken = (JwtSecurityToken)validatedToken; var userId = int.Parse(jwtToken.Claims.First(x => x.Type == "id").Value); // attach user to context on successful jwt validation context.Items["User"] = userService.GetById(userId); } catch { // do nothing if jwt validation fails // user is not attached to context so request won't have access to secure routes } }
public ContactAttributeService(IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper, IMinistryPlatformService ministryPlatformService, IApiUserService apiUserService) : base(authenticationService, configurationWrapper) { _ministryPlatformService = ministryPlatformService; _apiUserService = apiUserService; }
public LoginUserFeatureSteps() { _requestDto = new HttpResponseModel(); _response = new HttpResponseModel(); _htpClient = HttpClientService.HttpClient; //_apiClient = new ApiClient(httpClientFactory); _apiClient = new ApiClient(); _apiUserService = new ApiUserService(_apiClient); _ExpectedHttpStatusCode = 200; }
public async Task Invoke(HttpContext context, IApiUserService userService) { var token = context.Request.Headers["Authorization"].FirstOrDefault()?.Split(" ").Last(); if (token != null) { attachUserToContext(context, userService, token); } await _next(context); }
public OpportunityServiceImpl(IMinistryPlatformService ministryPlatformService, IAuthenticationService authenticationService, IConfigurationWrapper configurationWrapper, IParticipantService participantService, IApiUserService apiUserService) : base(authenticationService, configurationWrapper) { _ministryPlatformService = ministryPlatformService; _participantService = participantService; _apiUserService = apiUserService; }
public GroupParticipantService(IDbConnection dbConnection, IConfigurationWrapper configurationWrapper, IMinistryPlatformService ministryPlatformService, IApiUserService apiUserService) { _dbConnection = dbConnection; _configurationWrapper = configurationWrapper; _ministryPlatformService = ministryPlatformService; _apiUserService = apiUserService; }
public AccountController(UserManager <AppUser> userManager, IIdentityServerInteractionService interaction, IAuthenticationSchemeProvider schemeProvider, IClientStore clientStore, IEventService events, SignInManager <AppUser> signInManager, IApiUserService apiUserService) { _userManager = userManager; _interaction = interaction; _schemeProvider = schemeProvider; _clientStore = clientStore; _events = events; _signInManager = signInManager; _apiUserService = apiUserService; }
public EventService(TranslationEventService eventService, IGroupService groupService, ICommunicationService communicationService, IContactService contactService, IContentBlockService contentBlockService, IConfigurationWrapper configurationWrapper, IApiUserService apiUserService, IContactRelationshipService contactRelationshipService, IGroupParticipantService groupParticipantService, IParticipantService participantService) { _eventService = eventService; _groupService = groupService; _communicationService = communicationService; _contactService = contactService; _contentBlockService = contentBlockService; _configurationWrapper = configurationWrapper; _apiUserService = apiUserService; _contactRelationshipService = contactRelationshipService; _groupParticipantService = groupParticipantService; _participantService = participantService; }
public ChildcareService(IEventParticipantService eventParticipantService, ICommunicationService communicationService, IConfigurationWrapper configurationWrapper, IContactService contactService, MinistryPlatform.Translation.Services.Interfaces.IEventService eventService, IParticipantService participantService, IServeService serveService, IDateTime dateTimeWrapper, IApiUserService apiUserService, Interfaces.IEventService crdsEventService) { _eventParticipantService = eventParticipantService; _communicationService = communicationService; _configurationWrapper = configurationWrapper; _contactService = contactService; _crdsEventService = crdsEventService; _eventService = eventService; _participantService = participantService; _serveService = serveService; _dateTimeWrapper = dateTimeWrapper; _apiUserService = apiUserService; }
public UsersController(IApiUserService userService) { _userService = userService; }
public SimpleAuthorizationServerProvider(IApiUserService userService) { _userService = userService; }
public UserController() { userLogic = new ApiUserService(); }
public ApiAuthenticationHandler(IOptionsMonitor <AuthenticationSchemeOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock, IApiUserService userService) : base(options, logger, encoder, clock) { service = userService; }
public ApiUsersController(IApiUserService ApiUserservice) { _ApiUserservice = ApiUserservice; }
public ApiUsersController(IApiUserService apiUserService) { _apiUserService = apiUserService; }
public GetApiKey(DiscordOAuth options, IApiUserService apiUserService, DiscordApiClient apiClient) { _discordOAuth = options; _apiUserService = apiUserService; _apiClient = apiClient; }
public GameController(IApiUserService userService, IGameService gameService) { _userService = userService; _gameService = gameService; }
public TokenController(IApiUserService apiUserService, ITokenService tokenService, ILogger logger) { _apiUserService = apiUserService; _tokenService = tokenService; _logger = logger; }
public EventController(IMinistryPlatformService ministryPlatformService, IApiUserService apiUserService, IEventService eventService) { this._ministryPlatformService = ministryPlatformService; _eventService = eventService; _apiUserService = apiUserService; }
public UserController() { userLogic = (IApiUserService)Activator.GetObject( typeof(IApiUserService), ApiConfig.ApiUserServiceIp); }
public WuraController(IApiUserService apiUserService, IApiLocationService apiLocationService) { _apiUserService = apiUserService; _apiLocationService = apiLocationService; }
public ApiKeyHandler(IApiUserService userService) { _userService = userService; }