Esempio n. 1
0
        /// <summary>
        /// Create internal client.
        /// </summary>
        /// <returns>InternalClient.</returns>
        internal InternalClient CreateClient()
        {
            if (this.internalClient != null)
            {
                return(this.internalClient);
            }

            TokenCredentials credentials;

            if (!string.IsNullOrEmpty(this.bearerToken))
            {
                credentials         = new TokenCredentials(this.bearerToken);
                this.internalClient = new InternalClient(credentials)
                {
                    BaseUri = this.options.FileSecurityServiceUri,
                };
            }
            else
            {
                var tokenProvider = this.tokenProviderFactory.GetProvider(this.httpClient);
                this.internalClient = new InternalClient(new TokenCredentials(tokenProvider))
                {
                    BaseUri = this.options.FileSecurityServiceUri,
                };
            }

            return(this.internalClient);
        }
        /// <summary>
        /// Create internal client.
        /// </summary>
        /// <returns>InternalClient.</returns>
        internal InternalClient CreateClient()
        {
            if (this.internalClient != null)
            {
                return(this.internalClient);
            }

            var tokenProvider = this.tokenProviderFactory.GetProvider(this.httpClient);

            this.internalClient = new InternalClient(new TokenCredentials(tokenProvider))
            {
                BaseUri = this.options.FileSecurityServiceUri,
            };

            return(this.internalClient);
        }