シナリオ: STS (Java/Metro) から取得したトークンによる認証を必要とする Java/Metro Web サービスにアクセスするための WCF クライアントを作成しています。サービスの WSDL からの関連するポリシー スニペットは次のとおりです。
<sp:IssuedToken sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
<sp:Issuer>
<wsa:Address>...</wsa:Address>
<Metadata xmlns="http://www.w3.org/2005/08/addressing">
<Metadata xmlns="http://schemas.xmlsoap.org/ws/2004/09/mex">
<MetadataSection>
<MetadataReference>
<Address xmlns="http://www.w3.org/2005/08/addressing">...</Address>
</MetadataReference>
</MetadataSection>
</Metadata>
</Metadata>
</sp:Issuer>
<t:Claims Dialect="http://schemas.xmlsoap.org/ws/2005/05/identity">
<ClaimType xmlns="http://schemas.xmlsoap.org/ws/2005/05/identity" Optional="false" Uri="..."/>
<ClaimType xmlns="http://schemas.xmlsoap.org/ws/2005/05/identity" Optional="false" Uri="..."/>
</t:Claims>
<sp:RequestSecurityTokenTemplate>
<t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/SymmetricKey</t:KeyType>
<t:KeySize>256</t:KeySize>
</sp:RequestSecurityTokenTemplate>
<wsp:Policy>
<sp:RequireDerivedKeys/>
<sp:RequireInternalReference/>
</wsp:Policy>
</sp:IssuedToken>
WS-SecurityPolicy 1.2 で定義されているように、の外側の<Claims>
部分に注意してください(これは、 が含まれていた以前のバージョンから変更されています)。<RequestSecurityTokenTemplate>
<Claims>
そのように配置すると、完全にsvcutil
無視されます。<Claims>
ただし、RST テンプレート内に配置すると、生成された構成にコピーされます。
<binding ...>
<security ...>
<issuedTokenParameters ...>
<additionalRequestParameters>
<!-- The RST template is copied here -->
</additionalRequestParameters>
...
</issuedTokenParameters>
</security>
...
</binding>
WCF は WS-SecurityPolicy 1.2をサポートすると主張しています (しゃれは意図していません) 。私見、ポリシーからのクレームは常に<additionalRequestParameters>
バインディング構成に表示される必要があります。