Esempio n. 1
0
        public AzureAdAuthenticatedHttpMessageHandler(AzureAdAuthenticatedHttpClientOptions options)
        {
            Contract.Requires(options != null);

            _resourceId = options.ResourceId;

            var authority = String.Format(CultureInfo.InvariantCulture, options.AadInstance, options.Tenant);

            _authContext = new AuthenticationContext(authority);

            _clientCredential = new ClientCredential(options.ClientId, options.AppKey);
        }
Esempio n. 2
0
        public static HttpClient GetClient(AzureAdAuthenticatedHttpClientOptions options)
        {
            var msgHandler = new AzureAdAuthenticatedHttpMessageHandler(options);

            return(new HttpClient(msgHandler));
        }
Esempio n. 3
0
 public AzureAdAuthenticatedHttpMessageHandler(
     AzureAdAuthenticatedHttpClientOptions options,
     HttpMessageHandler innerHandler) : this(options)
 {
     InnerHandler = innerHandler;
 }