public virtual void AddClaim(Claim claim)
        {
            if (claim == null)
            {
                throw new ArgumentNullException(nameof(claim));
            }

            ClaimTypes.Add(claim.Type);
            ClaimValues.Add(claim.Value);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a shallow copy of 'other'.
        /// </summary>
        /// <param name="other">The WSTrustTokenParameters to copy.</param>
        protected WSTrustTokenParameters(WSTrustTokenParameters other)
            : base(other)
        {
            foreach (var parameter in other.AdditionalRequestParameters)
            {
                AdditionalRequestParameters.Add(parameter);
            }

            CacheIssuedTokens = other.CacheIssuedTokens;
            foreach (var claimType in ClaimTypes)
            {
                ClaimTypes.Add(claimType);
            }

            _issuedTokenRenewalThresholdPercentage = other.IssuedTokenRenewalThresholdPercentage;
            KeySize = other.KeySize;
            _maxIssuedTokenCachingTime = other.MaxIssuedTokenCachingTime;
            _messageSecurityVersion    = other.MessageSecurityVersion;
        }