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; }
/// <summary> /// Instantiates a <see cref="WSTrustChannelSecurityTokenManager"/>. /// </summary> /// <param name="wsTrustChannelClientCredentials"> the WSTrustChannelClientCredentials that can serve up a SecurityTokenProvider to use.</param> public WSTrustChannelSecurityTokenManager(WSTrustChannelClientCredentials wsTrustChannelClientCredentials) : base(wsTrustChannelClientCredentials) { _wsTrustChannelClientCredentials = wsTrustChannelClientCredentials ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelper(new ArgumentNullException(nameof(wsTrustChannelClientCredentials)), System.Diagnostics.Tracing.EventLevel.Error); }