コード例 #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);
        }
コード例 #2
0
        public static HttpClient GetClient(AzureAdAuthenticatedHttpClientOptions options)
        {
            var msgHandler = new AzureAdAuthenticatedHttpMessageHandler(options);

            return(new HttpClient(msgHandler));
        }
コード例 #3
0
 public AzureAdAuthenticatedHttpMessageHandler(
     AzureAdAuthenticatedHttpClientOptions options,
     HttpMessageHandler innerHandler) : this(options)
 {
     InnerHandler = innerHandler;
 }