internal static Exception CreateFailedAuthenticationFaultException() { SecurityVersion version = SecurityVersion.Default; FaultCode code = FaultCode.CreateSenderFaultCode(version.InvalidSecurityFaultCode.Value, version.HeaderNamespace.Value); return(new FaultException(new FaultReason(System.ServiceModel.SR.GetString("AuthenticationOfClientFailed"), CultureInfo.CurrentCulture), code)); }
internal static Exception CreateFailedAuthenticationFaultException() { SecurityVersion wss = SecurityVersion.Default; FaultCode faultCode = FaultCode.CreateSenderFaultCode(wss.InvalidSecurityFaultCode.Value, wss.HeaderNamespace.Value); FaultReason faultReason = new FaultReason(SR.AuthenticationOfClientFailed); return(new FaultException(faultReason, faultCode)); }
protected SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityVersion version) { if (version == null) { throw System.ServiceModel.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("version")); } return(this.CreateSecurityTokenSerializer(MessageSecurityTokenVersion.GetSecurityTokenVersion(version, true))); }
public SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityVersion version) { if (version == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError((Exception) new ArgumentNullException("version")); } return(this.CreateSecurityTokenSerializer((SecurityTokenVersion)MessageSecurityTokenVersion.GetSecurityTokenVersion(version, true))); }
internal static FaultException CreateAccessDeniedFaultException() { SecurityVersion wss = SecurityVersion.WSSecurity11; FaultCode faultCode = FaultCode.CreateSenderFaultCode("FailedAuthentication", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"); FaultReason faultReason = new FaultReason(new FaultReasonText("Access is denied", CultureInfo.CurrentCulture)); return(new FaultException(faultReason, faultCode)); }
internal static Exception CreateAccessDeniedFaultException() { SecurityVersion wss = SecurityVersion.Default; FaultCode faultCode = FaultCode.CreateSenderFaultCode(wss.FailedAuthenticationFaultCode.Value, wss.HeaderNamespace.Value); FaultReason faultReason = new FaultReason(SR.AccessDenied, CultureInfo.CurrentCulture); return(new FaultException(faultReason, faultCode)); }
internal static Exception CreateFailedAuthenticationFaultException() { // always use default version? SecurityVersion wss = SecurityVersion.Default; FaultCode faultCode = FaultCode.CreateSenderFaultCode(wss.InvalidSecurityFaultCode.Value, wss.HeaderNamespace.Value); FaultReason faultReason = new FaultReason(SR.GetString(SR.AuthenticationOfClientFailed), CultureInfo.CurrentCulture); return(new FaultException(faultReason, faultCode)); }
public StartSaml2TokenSerializerAdapter(SecurityTokenHandlerCollection securityTokenHandlerCollection, SecurityVersion securityVersion) : base(securityTokenHandlerCollection, securityVersion) { samlHandler = new StartSaml2SecurityTokenHandler() { Configuration = securityTokenHandlerCollection.Configuration }; }
public override SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityTokenVersion version) { bool bsp = version.GetSecuritySpecifications().Contains(Constants.WSBasicSecurityProfileCore1); SecurityVersion ver = version.GetSecuritySpecifications().Contains(Constants.Wss11Namespace) ? SecurityVersion.WSSecurity11 : SecurityVersion.WSSecurity10; return(new WSSecurityTokenSerializer(ver, bsp)); }
/// <summary> /// Dummy constructor used to resemble System.ServiceModel.Security.WSSecurityTokenSerializer. /// In order to make switching back to wcf version easier. /// </summary> /// <param name="securityVersion"></param> /// <param name="emitBspRequiredAttributes"></param> public WSSecurityTokenSerializer(SecurityVersion securityVersion, bool emitBspRequiredAttributes) { if (securityVersion != SecurityVersion.WSSecurity10) { throw new NotSupportedException("No other security version other than WSSecurity10 is supported."); } if (!emitBspRequiredAttributes) { throw new NotSupportedException("Always emits bspRequiredAttributes."); } }
public static WSS Create(SecurityVersion securityVersion) { if (securityVersion == SecurityVersion.WSSecurity10) { return(new WSS10()); } else if (securityVersion == SecurityVersion.WSSecurity11) { return(new WSS11()); } else { throw new NotSupportedException(); } }
private SecurityTokenSerializer WrapTokenHandlersAsSecurityTokenSerializer(SecurityTokenVersion version) { TrustVersion trustVersion = TrustVersion.WSTrust13; SecureConversationVersion scVersion = SecureConversationVersion.WSSecureConversation13; SecurityVersion securityVersion = SecurityVersion.WSSecurity11; foreach (string securitySpecification in version.GetSecuritySpecifications()) { if (StringComparer.Ordinal.Equals(securitySpecification, WSTrustFeb2005Constants.NamespaceURI)) { trustVersion = TrustVersion.WSTrustFeb2005; } else if (StringComparer.Ordinal.Equals(securitySpecification, WSTrust13Constants.NamespaceURI)) { trustVersion = TrustVersion.WSTrust13; } else if (StringComparer.Ordinal.Equals(securitySpecification, System.IdentityModel.WSSecureConversationFeb2005Constants.Namespace)) { scVersion = SecureConversationVersion.WSSecureConversationFeb2005; } else if (StringComparer.Ordinal.Equals(securitySpecification, System.IdentityModel.WSSecureConversation13Constants.Namespace)) { scVersion = SecureConversationVersion.WSSecureConversation13; } } securityVersion = FederatedSecurityTokenManager.GetSecurityVersion(version); // // SecurityTokenHandlerCollectionManager sthcm = this.parent.SecurityTokenHandlerCollectionManager; WsSecurityTokenSerializerAdapter adapter = new WsSecurityTokenSerializerAdapter(sthcm[SecurityTokenHandlerCollectionManager.Usage.Default], securityVersion, trustVersion, scVersion, false, null, null, null); return(adapter); }
public CustomTokenSerializer(SecurityVersion sv) : base(sv) { }
public P6TokenSerializer(SecurityVersion sv) : base(sv) { }
protected SecurityTokenSerializer CreateSecurityTokenSerializer(SecurityVersion version) { return(new WSSecurityTokenSerializer(version)); }
static SecurityVersion () { wss10 = new SecurityVersion10 (); wss11 = new SecurityVersion11 (); }
static SecurityVersion() { wss10 = new SecurityVersion10(); wss11 = new SecurityVersion11(); }