public void SetTokenProcessor(string clientId, Func <ClientCertificateInfo, HttpClient, Task <ClientCertificateToken> > processor)
        {
            var old = _clientList.FirstOrDefault(c => c.ClientID == clientId);

            if (old != null && processor != null)
            {
                old.Processor = CertificateProcessor.CreateDelegateProcessor(processor);
            }
        }
        public void SetTokenProcessor(string clientId, CertificateProcessor processor)
        {
            var old = _clientList.FirstOrDefault(c => c.ClientID == clientId);

            if (old != null)
            {
                old.Processor = processor;
            }
        }
 public ClientCertificateManager(
     ClientCertificateInfo client,
     CertificateProcessor processor,
     SetTokenProcessor tokenSetter,
     CheckResponseProcessor responseChecker,
     TokenCacheManager cacheManager,
     ILogger <ClientCertificateManager> logger,
     IHttpClientFactory clientFactory)
 {
     Client           = client;
     _processor       = processor;
     _tokenSetter     = tokenSetter;
     _responseChecker = responseChecker;
     _cacheManager    = cacheManager;
     _clientFactory   = clientFactory;
     _logger          = logger;
 }
 public ClientItem SetProcessor(Func <ClientCertificateInfo, HttpClient, Task <ClientCertificateToken> > processor)
 {
     Processor = CertificateProcessor.CreateDelegateProcessor(processor);
     return(this);
 }
 public ClientItem SetProcessor(CertificateProcessor processor)
 {
     Processor = processor;
     return(this);
 }
        public ClientItem AddClient(string url, string clientId, string clientSecret, string clientName = "", CertificateProcessor processor = null, Func <IServiceProvider, string, TokenCacheManager> tokenManagerFactory = null, SetTokenProcessor tokenSetter = null, CheckResponseProcessor responseChecker = null)
        {
            var old = _clientList.FirstOrDefault(c => c.ClientID == clientId);

            if (old == null)
            {
                old = new ClientItem();
                _clientList.Add(old);
            }

            old.ClientID          = clientId;
            old.ClientSecret      = clientSecret;
            old.AuthUrl           = url;
            old.ClientName        = clientName;
            old.Processor         = processor;
            old.TokenCacheManager = tokenManagerFactory;
            old.TokenSetter       = tokenSetter;
            old.ResponseChecker   = responseChecker;

            return(old);
        }