public WS2007FederationHttpBinding(WSFederationHttpSecurityMode securityMode, bool reliableSessionEnabled)
     : base(securityMode, reliableSessionEnabled)
 {
     this.ReliableSessionBindingElement.ReliableMessagingVersion = WS2007ReliableMessagingVersion;
     this.TransactionFlowBindingElement.TransactionProtocol = WS2007TransactionProtocol;
     this.HttpsTransport.MessageSecurityVersion = WS2007MessageSecurityVersion;
 }
        WSFederationHttpSecurity(WSFederationHttpSecurityMode mode, FederatedMessageSecurityOverHttp messageSecurity)
        {
            Fx.Assert(WSFederationHttpSecurityModeHelper.IsDefined(mode), string.Format("Invalid WSFederationHttpSecurityMode value: {0}", mode.ToString()));

            this.mode = mode;
            this.messageSecurity = messageSecurity == null ? new FederatedMessageSecurityOverHttp() : messageSecurity;
        }
 internal static bool IsDefined(WSFederationHttpSecurityMode value)
 {
     if ((value != WSFederationHttpSecurityMode.None) && (value != WSFederationHttpSecurityMode.Message))
     {
         return (value == WSFederationHttpSecurityMode.TransportWithMessageCredential);
     }
     return true;
 }
 internal static bool TryCreate(SecurityBindingElement sbe, WSFederationHttpSecurityMode mode, HttpTransportSecurity transportSecurity, bool isReliableSessionEnabled, MessageSecurityVersion version, out WSFederationHttpSecurity security)
 {
     security = null;
     FederatedMessageSecurityOverHttp messageSecurity = null;
     if (sbe == null)
     {
         mode = WSFederationHttpSecurityMode.None;
     }
     else
     {
         mode &= WSFederationHttpSecurityMode.TransportWithMessageCredential | WSFederationHttpSecurityMode.Message;
         if (!FederatedMessageSecurityOverHttp.TryCreate(sbe, mode == WSFederationHttpSecurityMode.TransportWithMessageCredential, isReliableSessionEnabled, version, out messageSecurity))
         {
             return false;
         }
     }
     security = new WSFederationHttpSecurity(mode, messageSecurity);
     return true;
 }
        internal static bool TryCreate(SecurityBindingElement sbe,
                                       WSFederationHttpSecurityMode mode,
                                       HttpTransportSecurity transportSecurity,
                                       bool isReliableSessionEnabled,
                                       MessageSecurityVersion version,
                                       out WSFederationHttpSecurity security)
        {
            security = null;
            FederatedMessageSecurityOverHttp messageSecurity = null;
            if (sbe == null)
            {
                mode = WSFederationHttpSecurityMode.None;
            }
            else
            {
                mode &= WSFederationHttpSecurityMode.Message | WSFederationHttpSecurityMode.TransportWithMessageCredential;
                Fx.Assert(WSFederationHttpSecurityModeHelper.IsDefined(mode), string.Format("Invalid WSFederationHttpSecurityMode value: {0}", mode.ToString()));

                if (!FederatedMessageSecurityOverHttp.TryCreate(sbe, mode == WSFederationHttpSecurityMode.TransportWithMessageCredential, isReliableSessionEnabled, version, out messageSecurity))
                    return false;
            }
            security = new WSFederationHttpSecurity(mode, messageSecurity);
            return true;
        }
		internal WSFederationHttpSecurity (WSFederationHttpSecurityMode mode)
		{
			this.Mode = mode;
			message = new FederatedMessageSecurityOverHttp ();
		}
 internal static bool IsDefined(WSFederationHttpSecurityMode value)
 {
     return (value == WSFederationHttpSecurityMode.None ||
         value == WSFederationHttpSecurityMode.Message ||
         value == WSFederationHttpSecurityMode.TransportWithMessageCredential);
 }
Example #8
0
		public WSFederationHttpBinding (
			WSFederationHttpSecurityMode securityMode,
			bool reliableSessionEnabled)
		{
			security = new WSFederationHttpSecurity (securityMode);
		}
 public WSFederationHttpBinding(WSFederationHttpSecurityMode securityMode, bool reliableSessionEnabled)
     : base(reliableSessionEnabled)
 {
     security.Mode = securityMode;
 }
 public WS2007FederationHttpBinding(WSFederationHttpSecurityMode securityMode)
     : this(securityMode, false)
 {
 }
 static bool TryCreateSecurity(SecurityBindingElement sbe, WSFederationHttpSecurityMode mode, HttpTransportSecurity transportSecurity, bool isReliableSession, out WSFederationHttpSecurity security)
 {
     if (!WSFederationHttpSecurity.TryCreate(sbe, mode, transportSecurity, isReliableSession, WS2007MessageSecurityVersion, out security))
         return false;
     // the last check: make sure that security binding element match the incoming security
     return SecurityElement.AreBindingsMatching(security.CreateMessageSecurity(isReliableSession, WS2007MessageSecurityVersion), sbe);
 }
 public WS2007FederationHttpBinding(WSFederationHttpSecurityMode securityMode)
 {
 }
 public WS2007FederationHttpBinding(WSFederationHttpSecurityMode securityMode, bool reliableSessionEnabled)
 {
 }
 private static bool TryCreateSecurity(SecurityBindingElement sbe, WSFederationHttpSecurityMode mode, HttpTransportSecurity transportSecurity, bool isReliableSession, out WSFederationHttpSecurity security)
 {
     if (!WSFederationHttpSecurity.TryCreate(sbe, mode, transportSecurity, isReliableSession, WS2007MessageSecurityVersion, out security))
     {
         return false;
     }
     return SecurityElementBase.AreBindingsMatching(security.CreateMessageSecurity(isReliableSession, WS2007MessageSecurityVersion), sbe);
 }
 private WSFederationHttpSecurity(WSFederationHttpSecurityMode mode, FederatedMessageSecurityOverHttp messageSecurity)
 {
     this.mode = mode;
     this.messageSecurity = (messageSecurity == null) ? new FederatedMessageSecurityOverHttp() : messageSecurity;
 }
Example #16
0
		public WSFederationHttpBinding (
			WSFederationHttpSecurityMode securityMode)
			: this (securityMode, true)
		{
		}
 internal static bool GetSecurityModeFromTransport(TransportBindingElement transport, HttpTransportSecurity transportSecurity, out WSFederationHttpSecurityMode mode)
 {
     mode = WSFederationHttpSecurityMode.None | WSFederationHttpSecurityMode.Message | WSFederationHttpSecurityMode.TransportWithMessageCredential;
     if (transport is HttpsTransportBindingElement)
     {
         mode = WSFederationHttpSecurityMode.TransportWithMessageCredential;
     }
     else if (transport is HttpTransportBindingElement)
     {
         mode = WSFederationHttpSecurityMode.None | WSFederationHttpSecurityMode.Message;
     }
     else
     {
         return false;
     }
     return true;
 }