public ProductScoreApiWrapper(HttpClient productScoresApi, IProductScoresApiConfig config) { _httpClient = productScoresApi; _productscoresApiUri = new Uri(config.Api.Url); var token = GetAuthenticationToken(config.Authentication.Url, config.Authentication.Username, config.Authentication.Password).Result; _httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.AccessToken); }
public EditController(IProductScoresApiConfig productScoreApiConfiguration) { //TODO: I'm still not happy with creating a new HTTPCLient all the time _productScoreApiWrapper = new ProductScoreApiWrapper(new HttpClient(), productScoreApiConfiguration); }
public HomeController(IProductScoresApiConfig configuration) { _configuration = configuration; }