Example #1
0
 public AccountManagerAccessTokenAccessor(IOptions <SFCCEnvironment> envOptions, IHttpClientFactory clientFactory,
                                          ILogger <AccountManagerAccessTokenAccessor> logger)
 {
     _environment = envOptions.Value;
     _environment.IsValidEnvironment(throwOnInvalid: true);
     _environment.HasClientCredentials(throwOnInvalid: true);
     _clientFactory = clientFactory;
     _logger        = logger;
 }
Example #2
0
        public SFCCWebDAVClient(ILogger <SFCCWebDAVClient> logger, IOptions <SFCCEnvironment> envOptions,
                                IHttpClientFactory clientFactory)
        {
            _logger        = logger;
            _env           = envOptions.Value;
            _clientFactory = clientFactory;

            // web dav client requires a valid environment context
            _env.IsValidEnvironment(true);
        }
        public BusinessManagerAccessTokenAccessor(IOptions <SFCCEnvironment> envOptions, IHttpClientFactory clientFactory, ILogger <AccountManagerAccessTokenAccessor> logger)
        {
            _environment = envOptions.Value;
            _environment.IsValidEnvironment(throwOnInvalid: true);
            _clientFactory = clientFactory;
            _logger        = logger;

            if (string.IsNullOrEmpty(_environment.Username) || string.IsNullOrEmpty(_environment.ClientID))
            {
                throw new Exception("Business Manager token accessor requires both a valid business manager account and client ID/secret");
            }
        }