예제 #1
0
        public override void OnClose(TimeSpan timeout)
        {
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

            if (this.clientTokenProvider != null)
            {
                SecurityUtils.CloseTokenProviderIfRequired(this.ClientTokenProvider, timeoutHelper.RemainingTime());
                this.clientTokenProvider = null;
            }
            if (this.serverTokenAuthenticator != null)
            {
                SecurityUtils.CloseTokenAuthenticatorIfRequired(this.ServerTokenAuthenticator, timeoutHelper.RemainingTime());
                this.serverTokenAuthenticator = null;
            }
            base.OnClose(timeoutHelper.RemainingTime());
        }
예제 #2
0
        public override void OnClose(TimeSpan timeout)
        {
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

            if (!this.ActAsInitiator)
            {
                if (this.recipientAsymmetricTokenProvider != null)
                {
                    SecurityUtils.CloseTokenProviderIfRequired(this.recipientAsymmetricTokenProvider, timeoutHelper.RemainingTime());
                }
                if (this.recipientCryptoTokenAuthenticator != null)
                {
                    SecurityUtils.CloseTokenAuthenticatorIfRequired(this.recipientCryptoTokenAuthenticator, timeoutHelper.RemainingTime());
                }
            }
            base.OnClose(timeoutHelper.RemainingTime());
        }
예제 #3
0
        public override void OnClose(TimeSpan timeout)
        {
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

            if (this.Factory.ActAsInitiator)
            {
                SecurityTokenProvider provider = this.initiatorSymmetricTokenProvider ?? this.initiatorAsymmetricTokenProvider;
                if (provider != null)
                {
                    SecurityUtils.CloseTokenProviderIfRequired(provider, timeoutHelper.RemainingTime());
                }
                if (this.initiatorTokenAuthenticator != null)
                {
                    SecurityUtils.CloseTokenAuthenticatorIfRequired(this.initiatorTokenAuthenticator, timeoutHelper.RemainingTime());
                }
            }
            base.OnClose(timeoutHelper.RemainingTime());
        }
예제 #4
0
        public virtual void OnClose(TimeSpan timeout)
        {
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);

            if (!_actAsInitiator)
            {
                foreach (SupportingTokenAuthenticatorSpecification spec in _channelSupportingTokenAuthenticatorSpecification)
                {
                    SecurityUtils.CloseTokenAuthenticatorIfRequired(spec.TokenAuthenticator, timeoutHelper.RemainingTime());
                }
                foreach (string action in _scopedSupportingTokenAuthenticatorSpecification.Keys)
                {
                    ICollection <SupportingTokenAuthenticatorSpecification> supportingAuthenticators = _scopedSupportingTokenAuthenticatorSpecification[action];
                    foreach (SupportingTokenAuthenticatorSpecification spec in supportingAuthenticators)
                    {
                        SecurityUtils.CloseTokenAuthenticatorIfRequired(spec.TokenAuthenticator, timeoutHelper.RemainingTime());
                    }
                }
            }
        }
예제 #5
0
        public virtual void OnClose(TimeSpan timeout)
        {
            if (this.actAsInitiator)
            {
                return;
            }
#if FEATURE_CORECLR
            throw new NotImplementedException("scopedSupportingTokenAuthenticatorSpecification not supported in .NET Core");
#else
            TimeoutHelper timeoutHelper = new TimeoutHelper(timeout);
            foreach (SupportingTokenAuthenticatorSpecification authenticatorSpecification in (IEnumerable <SupportingTokenAuthenticatorSpecification>) this.channelSupportingTokenAuthenticatorSpecification)
            {
                SecurityUtils.CloseTokenAuthenticatorIfRequired(authenticatorSpecification.TokenAuthenticator, timeoutHelper.RemainingTime());
            }
            foreach (string key in this.scopedSupportingTokenAuthenticatorSpecification.Keys)
            {
                foreach (SupportingTokenAuthenticatorSpecification authenticatorSpecification in (IEnumerable <SupportingTokenAuthenticatorSpecification>) this.scopedSupportingTokenAuthenticatorSpecification[key])
                {
                    SecurityUtils.CloseTokenAuthenticatorIfRequired(authenticatorSpecification.TokenAuthenticator, timeoutHelper.RemainingTime());
                }
            }
#endif
        }