private WS2007FederationHttpBinding(WSFederationHttpSecurity security, PrivacyNoticeBindingElement privacy, bool reliableSessionEnabled)
     : base(security, privacy, reliableSessionEnabled)
 {
     this.ReliableSessionBindingElement.ReliableMessagingVersion = s_WS2007ReliableMessagingVersion;
     this.TransactionFlowBindingElement.TransactionProtocol      = s_WS2007TransactionProtocol;
     this.HttpsTransport.MessageSecurityVersion = s_WS2007MessageSecurityVersion;
 }
        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);
        }
        private static void GetWSFederationHttpBindingDetails(WSFederationHttpBinding binding, ref string name, ref string mode, ref string credentialType)
        {
            if (binding is WS2007FederationHttpBinding)
            {
                name = GetBindingName <WS2007FederationHttpBinding>(binding);
            }
            else
            {
                name = GetBindingName <WSFederationHttpBinding>(binding);
            }

            WSFederationHttpSecurity wSFederationHttpSecurity = binding.Security;

            mode = wSFederationHttpSecurity?.Mode.ToString();
            switch (wSFederationHttpSecurity?.Mode)
            {
            case WSFederationHttpSecurityMode.None:
                credentialType = "N/A";
                break;

            case WSFederationHttpSecurityMode.Message:
            case WSFederationHttpSecurityMode.TransportWithMessageCredential:
                credentialType = wSFederationHttpSecurity.Message?.IssuedTokenType ?? "null";
                break;
            }
        }
 WS2007FederationHttpBinding(WSFederationHttpSecurity security, PrivacyNoticeBindingElement privacy, bool reliableSessionEnabled)
     : base(security, privacy, reliableSessionEnabled)
 {
     this.ReliableSessionBindingElement.ReliableMessagingVersion = WS2007ReliableMessagingVersion;
     this.TransactionFlowBindingElement.TransactionProtocol = WS2007TransactionProtocol;
     this.HttpsTransport.MessageSecurityVersion = WS2007MessageSecurityVersion;
 }
 private static bool TryCreateSecurity(SecurityBindingElement sbe, WSFederationHttpSecurityMode mode, HttpTransportSecurity transportSecurity, bool isReliableSession, out WSFederationHttpSecurity security)
 {
     if (!WSFederationHttpSecurity.TryCreate(sbe, mode, transportSecurity, isReliableSession, WSMessageSecurityVersion, out security))
     {
         return(false);
     }
     return(SecurityElementBase.AreBindingsMatching(security.CreateMessageSecurity(isReliableSession, WSMessageSecurityVersion), sbe));
 }
 internal void ApplyConfiguration(WSFederationHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     security.Mode = this.Mode;
     this.Message.ApplyConfiguration(security.Message);
 }
 internal void InitializeFrom(WSFederationHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     this.Mode = security.Mode;
     this.Message.InitializeFrom(security.Message);
 }
 private static bool TryCreateSecurity(SecurityBindingElement sbe, WSFederationHttpSecurityMode mode, HttpTransportSecurity transportSecurity, bool isReliableSession, out WSFederationHttpSecurity security)
 {
     if (!WSFederationHttpSecurity.TryCreate(sbe, mode, transportSecurity, isReliableSession, s_WS2007MessageSecurityVersion, out security))
     {
         return(false);
     }
     // the last check: make sure that security binding element match the incoming security
     return(System.ServiceModel.Configuration.SecurityElement.AreBindingsMatching(security.CreateMessageSecurity(isReliableSession, s_WS2007MessageSecurityVersion), sbe));
 }
 internal void InitializeFrom(WSFederationHttpSecurity security)
 {
     if (security == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("security");
     }
     SetPropertyValueIfNotDefaultValue(ConfigurationStrings.Mode, security.Mode);
     this.Message.InitializeFrom(security.Message);
 }
 internal WSFederationHttpBinding(WSFederationHttpSecurity security, PrivacyNoticeBindingElement privacy, bool reliableSessionEnabled) : base(reliableSessionEnabled)
 {
     this.security = new WSFederationHttpSecurity();
     this.security = security;
     if (privacy != null)
     {
         this.privacyNoticeAt      = privacy.Url;
         this.privacyNoticeVersion = privacy.Version;
     }
 }
Beispiel #11
0
 internal WSFederationHttpBinding(WSFederationHttpSecurity security, PrivacyNoticeBindingElement privacy, bool reliableSessionEnabled)
     : base(reliableSessionEnabled)
 {
     _security = security;
     if (null != privacy)
     {
         _privacyNoticeAt      = privacy.Url;
         _privacyNoticeVersion = privacy.Version;
     }
 }
 internal WSFederationHttpBinding(WSFederationHttpSecurity security, PrivacyNoticeBindingElement privacy, bool reliableSessionEnabled)
     : base(reliableSessionEnabled)
 {
     this.security = security;
     if (null != privacy)
     {
         this.privacyNoticeAt = privacy.Url;
         this.privacyNoticeVersion = privacy.Version;
     }
 }
 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.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;
        }
 public WSFederationHttpBinding()
 {
     this.security = new WSFederationHttpSecurity();
 }
		internal void ApplyConfiguration (WSFederationHttpSecurity security)
		{
			security.Mode = Mode;
			Message.ApplyConfiguration (security.Message);
		}
 public WSFederationHttpBinding(
     WSFederationHttpSecurityMode securityMode,
     bool reliableSessionEnabled)
 {
     security = new WSFederationHttpSecurity(securityMode);
 }
 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);
 }
 public WSFederationHttpBinding()
 {
     this.security = new WSFederationHttpSecurity();
 }
		public WSFederationHttpBinding (
			WSFederationHttpSecurityMode securityMode,
			bool reliableSessionEnabled)
		{
			security = new WSFederationHttpSecurity (securityMode);
		}
 public WSFederationHttpBinding(WSFederationHttpSecurityMode securityMode, bool reliableSessionEnabled) : base(reliableSessionEnabled)
 {
     this.security      = new WSFederationHttpSecurity();
     this.security.Mode = securityMode;
 }
 public WSFederationHttpBinding(WSFederationHttpSecurityMode securityMode, bool reliableSessionEnabled) : base(reliableSessionEnabled)
 {
     this.security = new WSFederationHttpSecurity();
     this.security.Mode = securityMode;
 }
 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);
 }