このWSE3.0コードをWCFに変換しようとしています。
// we use Microsoft WSE 3.0 to insert the username token in the soap header.
// This strategy takes care of creating and inserting the Nonce and Created elements
// for us, as well as creating a password digest based on Nonce, Created, and
// the password itself. Refer to the WS-Secutiry UsernameToken Profile 1.1
// specification at http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss.
Microsoft.Web.Services3.Security.Tokens.UsernameToken nametoken;
nametoken = new Microsoft.Web.Services3.Security.Tokens.UsernameToken(username, password, Microsoft.Web.Services3.Security.Tokens.PasswordOption.SendHashed);
Microsoft.Web.Services3.Design.Policy ClientPolicy = new Microsoft.Web.Services3.Design.Policy();
ClientPolicy.Assertions.Add(new UsernameOverTransportAssertion());
this._proxy.SetPolicy(ClientPolicy);
this._proxy.SetClientCredential<UsernameToken>(nametoken);
Microsoft.Web.Services3.Security.Tokens.PasswordOption.SendHashed
ダイジェストモード(上記のコード`)でパスワードを送信することを除いて、私はかなり近づいています:
TransportSecurityBindingElement transportBindingElement =
SecurityBindingElement.CreateUserNameOverTransportBindingElement();
transportBindingElement.AllowInsecureTransport = true;
transportBindingElement.EnableUnsecuredResponse = true;
transportBindingElement.IncludeTimestamp = true;
var binding = new CustomBinding(new BindingElement[] { //
transportBindingElement, //
new TextMessageEncodingBindingElement() {
MessageVersion = MessageVersion.Soap11
}, //
new HttpTransportBindingElement() {
AuthenticationScheme = AuthenticationSchemes.Digest,
}, //
});
上記は、パスワードをプレーンテキスト(ハッシュなし)で送信します。カスタムトークンシリアライザーを作成せずにこれを行うようにWCFを設定することは不可能であると述べている誰かと、同様のコードを変換しようとしている誰かへのこのリンクを見つけました。
この声明は正確ですか?
もしそうなら、このカスタムシリアライザーを作成して使用するには何をする必要がありますか?
このリンクは、次の式を示すコメントでリンクされているサイトのPDFと組み合わせると、良い出発点になる可能性がありますPassword_Digest = Base64 ( SHA-1 ( nonce + created + password ) )
が、誰かが私が何から導き出す必要があるのか、WCFを使用する方法についてより良い説明があれば私の新しいシリアライザーそれを聞きたいです。