public override IChannelFactory <TChannel> BuildChannelFactory <TChannel>(BindingContext context) { WsTrustChannelClientCredentials trustCredentials = Find <WsTrustChannelClientCredentials>(context.BindingParameters); if (trustCredentials == null) { var clientCredentials = Find <ClientCredentials>(context.BindingParameters); if (clientCredentials != null) { trustCredentials = new WsTrustChannelClientCredentials(clientCredentials); context.BindingParameters.Remove(typeof(ClientCredentials)); context.BindingParameters.Add(trustCredentials); } else { trustCredentials = new WsTrustChannelClientCredentials(); context.BindingParameters.Add(trustCredentials); } } var channelFactory = base.BuildChannelFactory <TChannel>(context); return(channelFactory); }
/// <summary> /// /// </summary> /// <param name="wsTrustChannelClientCredentials"></param> public WsTrustChannelSecurityTokenManager(WsTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw LogHelper.LogArgumentNullException(nameof(wsTrustChannelClientCredentials)); }
/// <summary> /// Copy constructor /// </summary> /// <param name="other">The WSTrustChannelClientCredentials to create a copy of</param> protected WsTrustChannelClientCredentials(WsTrustChannelClientCredentials other) : base(other) { ClientCredentials = other.ClientCredentials; SecurityTokenManager = other.SecurityTokenManager; }