public StsTokenService(StsTokenServiceConfiguration config) { // Check input arguments if (config == null) { throw new ArgumentNullException(nameof(config)); } if (string.IsNullOrEmpty(config.WspEndpointId)) { throw new ArgumentException("WspEndpointId"); } if (string.IsNullOrEmpty(config.StsEndpointAddress)) { throw new ArgumentException("StsEndpointAddress"); } // X509FindType cannot be tested below because default value is FindByThumbprint if (config.ClientCertificate == null) { throw new ArgumentException("ClientCertificate"); } if (config.StsCertificate == null) { throw new ArgumentException("StsCertificate"); } // New object is created to ensure that configuration does not change. The alternative would be immutable objects. _config = new StsTokenServiceConfiguration { ClientCertificate = config.ClientCertificate, StsCertificate = config.StsCertificate, SendTimeout = config.SendTimeout, StsEndpointAddress = config.StsEndpointAddress, TokenLifeTimeInMinutes = config.TokenLifeTimeInMinutes, WspEndpointId = config.WspEndpointId }; }
public StsTokenServiceCache(StsTokenServiceConfiguration config) { _stsTokenService = new StsTokenService(config); _cacheClockSkew = config.CacheClockSkew; _wspEndpointId = config.WspEndpointId; }