Tôi cần cung cấp dịch vụ cho bên thứ ba sẽ gửi tin nhắn xà phòng có Dấu thời gian đã ký.Dịch vụ WCF với WS-Security yêu cầu Dấu thời gian đã ký chỉ
Tôi làm cách nào để định cấu hình dịch vụ của mình để hỗ trợ điều này?
CẬP NHẬT tôi đã quản lý để có được gần với định dạng của thông điệp Xà phòng mà chúng ta đang theo đuổi nhưng WCF khăng khăng ký cả tên người dùng và các thẻ timestamp, Có cách nào để thay đổi ràng buộc để chỉ ký dấu thời gian?
Cập nhật Hơn nữa Dưới đây là yêu cầu của chúng tôi:
- Yếu tố Timestamp PHẢI được ký kết.
- Tên CN trên chứng chỉ được sử dụng để ký PHẢI khớp với Tên người dùng cung cấp trong phần tử UsernameToken.
- Chứng chỉ được sử dụng để ký PHẢI được gửi trong phần tử BinarySecurityToken.
- Phần tử KeyInfo PHẢI chỉ chứa phần tử SecurityTokenReference, phần tử này phải được sử dụng để tham chiếu BinarySecurityToken.
- Thuật toán chuẩn hóa phải được chỉ định.
- SignatureMethod PHẢI được chỉ định và PHẢI là SHA-1 hoặc SHA-2 alghorithm.
- Chữ ký tách rời NÊN được sử dụng.
Mọi đề xuất?
HIỆN CONFIG
Khách hàng Binding
<bindings>
<wsHttpBinding>
<binding name="WSBC">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate" proxyCredentialType="None"></transport>
<message clientCredentialType="UserName" negotiateServiceCredential="false" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Khách hàng Endpoint
<client>
<endpoint address="https://localhost/WcfTestService/Service2.svc"
behaviorConfiguration="CCB" binding="wsHttpBinding"
bindingConfiguration="WSBC"
contract="ServiceReference2.IService2"
name="wsHttpBinding_IService2" />
</client>
Khách hàng Behavior
<behaviors>
<endpointBehaviors>
<behavior name="MBB">
<clientCredentials>
<clientCertificate findValue="03 58 d3 bf 4b e7 67 2e 57 05 47 dc e6 3b 52 7f f8 66 d5 2a"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="03 58 d3 bf 4b e7 67 2e 57 05 47 dc e6 3b 52 7f f8 66 d5 2a"
storeLocation="LocalMachine"
storeName="My"
x509FindType="FindByThumbprint" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
Dịch vụ Binding
<bindings>
<wsHttpBinding>
<binding name="ICB">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="Certificate" proxyCredentialType="None"></transport>
<message clientCredentialType="UserName"
negotiateServiceCredential="false"
establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Serice Endpoint
<service name="WcfTestService.Service2" behaviorConfiguration="SCB">
<endpoint address="" binding="wsHttpBinding" contract="WcfTestService.IService2"
bindingConfiguration="ICB" name="MS" />
</service>
Behavior Dịch vụ
<behaviors>
<serviceBehaviors>
<behavior name="SCB">
<serviceCredentials>
<serviceCertificate findValue="4d a9 d8 f2 fb 4e 74 bd a7 36 d7 20 a8 51 e2 e6 ea 7d 30 08"
storeLocation="LocalMachine"
storeName="TrustedPeople"
x509FindType="FindByThumbprint" />
<userNameAuthentication
userNamePasswordValidationMode="Custom"
customUserNamePasswordValidatorType="WcfTestService.UsernameValidator, WcfTestService" />
<clientCertificate>
<authentication certificateValidationMode="None" revocationMode="NoCheck" />
</clientCertificate>
</serviceCredentials>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
Bạn đã quản lý để cấu hình hoạt động sao cho chỉ có phần tử Dấu thời gian đã được ký? Tôi hiện đang cố gắng đạt được điều tương tự. – Edward