Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CvrClient"/> class.
        /// </summary>
        /// <param name="httpClient">The HTTP client to use. The caller is expected to manage this resource and it will not be disposed.</param>
        /// <param name="tokenProviderFactory">The Logic access token provider factory.</param>
        /// <param name="options">The required configuration options.</param>
        public CvrClient(HttpClient httpClient, LogicTokenProviderFactory tokenProviderFactory, CvrOptions options)
        {
            this.httpClient           = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
            this.options              = options ?? throw new ArgumentNullException(nameof(options));
            this.tokenProviderFactory = tokenProviderFactory ?? throw new ArgumentNullException(nameof(tokenProviderFactory));

#pragma warning disable CS0618 // Type or member is obsolete
            if (string.IsNullOrEmpty(this.tokenProviderFactory.DefaultAuthorizationScope))
            {
                this.tokenProviderFactory.DefaultAuthorizationScope = "https://logicidentityprod.onmicrosoft.com/bb159109-0ccd-4b08-8d0d-80370cedda84/.default";
            }
#pragma warning restore CS0618 // Type or member is obsolete
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CvrClient"/> class.
 /// </summary>
 /// <param name="httpClient">The HTTP client to use. The caller is expected to manage this resource and it will not be disposed.</param>
 /// <param name="tokenProviderFactory">The Logic access token provider factory.</param>
 /// <param name="options">The required configuration options.</param>
 public CvrClient(HttpClient httpClient, LogicTokenProviderFactory tokenProviderFactory, CvrOptions options)
 {
     this._httpClient           = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     this._options              = options ?? throw new ArgumentNullException(nameof(options));
     this._tokenProviderFactory = tokenProviderFactory ?? throw new ArgumentNullException(nameof(tokenProviderFactory));
 }