Re: who can give me a e.g using Customer UsernameToken



thanks Pablo
if i only use the customerUsernameToken, it worked well
but i have a problem
i wanna use public key in a certificate to encrypt the message, so i wrote
other policy
in the server policy:

<policy name="ServicePolicy">
<usernameForCertificateSecurity establishSecurityContext="false"
renewExpiredSecurityContext="true" requireSignatureConfirmation="false"
messageProtectionOrder="SignBeforeEncrypt" requireDerivedKeys="true"
ttlInSeconds="300">
<serviceToken>
<x509 storeLocation="LocalMachine" storeName="My"
findValue="CN=WSE2QuickStartServer" findType="FindBySubjectDistinguishedName"
/>
</serviceToken>
<protection>
<request signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
<response signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
<fault signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
</protection>
</usernameForCertificateSecurity>
<requireActionHeader />
<usernameOverTransportSecurity />
</policy>
and the client is
<policy name="ClientPolicy">
<usernameForCertificateSecurity establishSecurityContext="false"
renewExpiredSecurityContext="true" requireSignatureConfirmation="false"
messageProtectionOrder="SignBeforeEncrypt" requireDerivedKeys="true"
ttlInSeconds="300">
<serviceToken>
<x509 storeLocation="CurrentUser" storeName="AddressBook"
findValue="CN=WSE2QuickStartServer" findType="FindBySubjectDistinguishedName"
/>
</serviceToken>
<protection>
<request signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
<response signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="true" />
<fault signatureOptions="IncludeAddressing, IncludeTimestamp,
IncludeSoapBody" encryptBody="false" />
</protection>
</usernameForCertificateSecurity>
<requireActionHeader />
<usernameOverTransportSecurity />
</policy>
and then i got a mistake:
<faultcode
xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";>q0:InvalidSecurity</faultcode>
<faultstring>Microsoft.Web.Services3.Security.SecurityFault: An
error was discovered processing the <Security> header --->
System.Security.Cryptography.CryptographicException: WSE009: The input was
not a valid SOAP message because it had more than one element with the
following ID value: SecurityToken-385d18a3-1c78-49c4-b152-d90cd4fcae79.
at
Microsoft.Web.Services3.Security.MessageSignature.FindIdElements(XmlElement
element)
at
Microsoft.Web.Services3.Security.MessageSignature.FindIdElements(XmlElement
element)
...
how to solve this problem or can i use other method to encrypt with
customerUsernameToken?
.



Relevant Pages

  • how can i use customerusername token with certificate
    ... i wanna use public key in a certificate to encrypt the message, ... <response signatureOptions="IncludeAddressing, IncludeTimestamp, ... <fault signatureOptions="IncludeAddressing, IncludeTimestamp, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • WSE 3.0 - WSE2013 Error VS2005
    ... local "IIS" web server not cassini web server ... <response signatureOptions="IncludeAddressing, IncludeTimestamp, ... <fault signatureOptions="IncludeAddressing, IncludeTimestamp, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE 3: SOAP faults not being returned correctly from service.
    ... occurs when the caller doesn't sign or encrypt the SOAP message, ... fault that the sender *should* receive is: ... WSE should only use the client token to encrypt the response message (Using ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Unrecogniszed SOAPAction?
    ... <response signatureOptions="IncludeAddressing, IncludeTimestamp, ... Security requirements are not satisfied because the security header is ... HttpContext context, HttpRequest request, HttpResponse response, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: soap:Body not encrypted - wse 3.0
    ... <extension name="usernameForCertificateSecurity" type="Microsoft.Web.Services3.Design.UsernameForCertificateAssertion, ... <fault signatureOptions="IncludeAddressing, IncludeTimestamp, ...
    (microsoft.public.dotnet.framework.webservices.enhancements)