private void Initialize(SupportObserverDataProviderConfiguration configuration)
 {
     AuthenticationContext = new AuthenticationContext(configuration.AADAuthority);
     ClientCredential      = new ClientCredential(configuration.ClientId, configuration.AppKey);
     TokenServiceName      = "ObserverTokenRefresh";
     StartTokenRefresh();
 }
Ejemplo n.º 2
0
 public SupportObserverDataProviderBase(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration) : base(cache)
 {
     _configuration          = configuration;
     _httpClient             = GetObserverClient();
     _httpClient.BaseAddress = new Uri("https://wawsobserver-prod.azurewebsites.net/api/");
     _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 }
 public SupportObserverDataProviderBase(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration, DataProviderContext dataProviderContext) : base(cache)
 {
     Configuration       = configuration;
     RequestId           = dataProviderContext.RequestId;
     DataProviderContext = dataProviderContext;
     Logger                  = DiagnosticsETWProvider.Instance;
     _httpClient             = GetObserverClient();
     _httpClient.BaseAddress = new Uri($"{configuration.Endpoint}/api/");
     _httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
 }
 public SupportObserverDataProvider(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration) : base(cache, configuration)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ObserverTokenService"/> class.
 /// </summary>
 /// <param name="resourceId"></param>
 /// <param name="configuration"></param>
 public ObserverTokenService(string resourceId, SupportObserverDataProviderConfiguration configuration)
 {
     Resource = resourceId;
     Initialize(configuration);
 }
 public MockSupportObserverDataProvider(OperationDataCache cache, SupportObserverDataProviderConfiguration configuration, DataProviderContext dataProviderContext) : base(cache, configuration, dataProviderContext)
 {
 }