Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Consumir WS-Security sólo con firma del mensaje sobre SSL de dos v

61 views
Skip to first unread message

Rodrigo

unread,
Mar 3, 2009, 6:34:05 AM3/3/09
to
Hola.

Estoy intentando consumir un servicio Web con WS-Security. El servicio
únicamente usa de WS-Security la firma del cuerpo del mensaje. La
comunicación con el servicio Web se realiza bajo SSL de dos vías, motivo por
el cual no se emplean otras características de WS-Security.

Buscando en Internet he encontrado que el adaptador que debería usar para
WS-Security debería ser WCF-WSHttp, pero he visto que esto firma y encripta
el mensaje. Yo únicamente requiero la firma, por lo que esta solución no es
válida.

El adaptador necesario para personalizar más el adaptador sería el
WCF-Custom. He intentado personalizar el EndPointBehavior, pero no funciona.
Voy a exponer la configuración que he puesto, apreciaría cualquier ayuda en
localizar algún error en esta configuración:
General:
Address: https://.../axis2/services/...
EndPoint Identity: Not configured.
SOAP Action header: Configured whit the action
Binding:
BindingType: wsHTTPBinding
WSHttpBindingElement:
Security: mode = Transport
Transport:
clientCredentialType: Certifcate
proxyCredentialType: None
Message:
algorithmSuite: Default
clientCredentialType: None
negotiateServiceCredential: True
establishSecurityContext: False
Behavior:
CustomBehavior:
ProtectionLevel: Sign
clientCredentials:
supportInteractive: True
type: blank
ClientCertificate:
findValue: dd e6 ...
storeLocation: LocalMachine
storeName: My
x509FintType: FindByThumbprint
ServiceCertificate:
DefaultCertificate:
findValue: 4f 0b ...
storeLoation: CurrenUser
storeName: TrustedPeople
x509FindType: FindByThumbprint
ScopedCertificates:
Count: 0
Authentication:
certificateValidationMode: ChainTrust
customCertificateValidatorType: blank
revocationMode: Online
trustedStoreLocation: CurrentUser
El resto de configuración es la configuración por defecto.

The custom behavior it's a class than inherits from BehaviorExtensionElement
and IEndpointBehavior and implements the following code (Level is a
configuration exposed attribute of the class):

void IEndpointBehavior.AddBindingParameters(ServiceEndpoint endpoint,
BindingParameterCollection
bindingParameters)
{
endpoint.Contract.ProtectionLevel = Level;

bindingParameters.Remove<ChannelProtectionRequirements>();
ChannelProtectionRequirements requirements = new
ChannelProtectionRequirements ();
bindingParameters.Add(requirements);
MessagePartSpecification unprotectedBody = new MessagePartSpecification
();
MessagePartSpecification protectedBody = new
MessagePartSpecification(true);

switch (endpoint.Contract.ProtectionLevel)
{
case ProtectionLevel.None:
requirements.OutgoingSignatureParts.AddParts(unprotectedBody,
"*" );
requirements.IncomingSignatureParts.AddParts(unprotectedBody,
"*" );
requirements.OutgoingEncryptionParts.AddParts(unprotectedBody,
"*" );
requirements.IncomingEncryptionParts.AddParts(unprotectedBody,
"*" );
break;
case ProtectionLevel.Sign:
requirements.OutgoingSignatureParts.AddParts(protectedBody, "*" );
requirements.IncomingSignatureParts.AddParts(protectedBody, "*" );
requirements.OutgoingEncryptionParts.AddParts(unprotectedBody,
"*" );
requirements.IncomingEncryptionParts.AddParts(unprotectedBody,
"*" );
break;
case ProtectionLevel.EncryptAndSign:
requirements.OutgoingSignatureParts.AddParts(protectedBody, "*"
);
requirements.IncomingSignatureParts.AddParts(protectedBody, "*"
);
requirements.OutgoingEncryptionParts.AddParts(protectedBody, "*"
);
requirements.IncomingEncryptionParts.AddParts(protectedBody, "*"
);
break;
}
}

Agadecería cualquier ayuda que me puedan proporcionar, gracias.

Rodrigo

unread,
Mar 5, 2009, 4:46:12 AM3/5/09
to
Hola de nuevo. Por si a alguien tiene este mismo problema, está puesto en
inglés, que parece que es un canal un poco más vivo que este. Está en
"English/Servers/Server Applications/BizTalk Server/General/WS-Security only
with message signing with 2-ways SSL".
0 new messages