void InitializeCallStack()
 {
     if (OperationContext.Current == null || Header == null)
     {
         Header = new SecurityCallStack();
     }
     else
     {
         Header = SecurityCallStackContext.Current;
     }
 }
Example #2
0
 void LogCallChain(SecurityCallStack callStack)
 {
     //Log call stack here. For example:
     foreach (SecurityCallFrame call in callStack.Calls)
     {
         Trace.Write("Activity ID = " + call.ActivityId + ",");
         Trace.Write(" Address = " + call.Address + ",");
         Trace.Write(" Authentication = " + call.Authentication + ",");
         Trace.Write(" Time = " + call.CallTime + ",");
         Trace.Write(" Identity = " + call.IdentityName + ",");
         Trace.Write(" Operation = " + call.Operation + ",");
         Trace.WriteLine(" Caller = " + call.CallerType);
     }
 }
 void LogCallChain(SecurityCallStack callStack)
 {
     //Log call stack here. For example:
      foreach(SecurityCallFrame call in callStack.Calls)
      {
     Trace.Write("Activity ID = " + call.ActivityId + ",");
     Trace.Write(" Address = " + call.Address + ",");
     Trace.Write(" Authentication = " + call.Authentication + ",");
     Trace.Write(" Time = " + call.CallTime + ",");
     Trace.Write(" Identity = " + call.IdentityName + ",");
     Trace.Write(" Operation = " + call.Operation + ",");
     Trace.WriteLine(" Caller = " + call.CallerType);
      }
 }
        protected override void PreInvoke(object instance, object[] inputs)
        {
            try
            {
                SecurityCallStack callStack = SecurityCallStackContext.Current;

                LogCallChain(callStack);
                ValidateCallChain(callStack);
                SignCallChain(callStack);
            }
            catch (NullReferenceException)
            {
                throw new InvalidOperationException("No security call stack was found. Are you using the right proxy?");
            }
        }
 void ValidateCallChain(SecurityCallStack callStack)
 {
     //Perform custom validation steps here
 }
 void SignCallChain(SecurityCallStack callStack)
 {
     //Digitally sign call stack here
 }
Example #7
0
 void SignCallChain(SecurityCallStack callStack)
 {
     //Digitally sign call stack here
 }
Example #8
0
 void ValidateCallChain(SecurityCallStack callStack)
 {
     //Perform custom validation steps here
 }
 void ValidateCallChain(SecurityCallStack callStack)
 {
    //Perform custom validation steps here. For now:
    throw new SecurityException("You must provide code to sign the call stack"); 
 }
 void ValidateCallChain(SecurityCallStack callStack)
 {
     //Perform custom validation steps here. For now:
     throw new SecurityException("You must provide code to sign the call stack");
 }