/// <summary>Adds token replay validation.</summary>
        public TokenValidationPolicyBuilder EnableTokenReplayValidation(ITokenReplayCache tokenReplayCache)
        {
            if (tokenReplayCache == null)
            {
                throw new ArgumentNullException(nameof(tokenReplayCache));
            }

            AddValidator(new TokenReplayValidator(tokenReplayCache));
            return(this);
        }
예제 #2
0
 public virtual void Copy(ITokenReplayCache existingobject)
 {
     if ((existingobject == null))
     {
         return;
     }
     this._Id             = existingobject._Id;
     this._TokenKey       = existingobject._TokenKey;
     this._ExpirationTime = existingobject._ExpirationTime;
     this._SecurityToken  = existingobject._SecurityToken;
 }
예제 #3
0
 public virtual bool IsEqual(ITokenReplayCache existingobject)
 {
     if ((existingobject == null))
     {
         return(false);
     }
     if ((this._Id != existingobject._Id))
     {
         return(false);
     }
     if ((this._TokenKey != existingobject._TokenKey))
     {
         return(false);
     }
     if ((this._ExpirationTime != existingobject._ExpirationTime))
     {
         return(false);
     }
     if ((this._SecurityToken != existingobject._SecurityToken))
     {
         return(false);
     }
     return(true);
 }
예제 #4
0
 public TokenReplayValidator(ITokenReplayCache tokenReplayCache)
 {
     _tokenReplayCache = tokenReplayCache ?? throw new ArgumentNullException(nameof(tokenReplayCache));
 }
    /// <summary>
    /// Creates a client channel to call the service host.
    /// </summary>
    protected void Initialize()
    {
        ChannelFactory <ITokenReplayCache> cf = new ChannelFactory <ITokenReplayCache>(new WS2007HttpBinding(SecurityMode.None), new EndpointAddress(_serviceAddress));

        _tokenReplayCache = cf.CreateChannel();
    }