2009-06-02 3 views
12

とSharePointに認証を行うことは...接続し、私はこの1つでナットを行くよ、どこでも任意のまともな情報を見つけることができませんWCF

WCFとNTLMでのSharePoint 3.0 Webサービスへの接続に関する周りにたくさんの情報があります偽装。ただし、SharePointサービスにアクセスするクライアントがSharePointネットワークに対してリモートであり、認証が必要な場合、SharePointサービスに資格情報を設定して渡すのに最適です。

servicemodel.config内のSharePointボックスにローカルなWindowsユーザー名とパスワードを指定できます。SharePointインスタンスは、アクセスしているドメイン外のスタンドアロンとして実行されています。したがって、ドメインユーザーがsharepointボックスに存在しないため、偽装は無関係です。私は、次のコードのような多くの組み合わせを試してみました

が...しかし、私は繰り返しのような例外を取得:。

は、「HTTP要求は、クライアントの認証方式 『匿名』と不正なサーバから受信した認証ヘッダーは 'でしたNTLM、基本領域= "wss.internaldev.local"」

誰もがWindows資格情報を使用して "リモート" のSharePoint Webサービスに接続する例を提供することができます

ListsSoapClient proxy = new ListsSoapClient(); 

proxy.ClientCredentials.Windows.ClientCredential.UserName = "admin_user"; 
proxy.ClientCredentials.Windows.ClientCredential.Password = "admin_password"; 
proxy.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification; 

listItems = proxy.GetListItems(...); 

proxy.Close(); 

バインディングの例を:。?

<security mode="TransportCredentialOnly"> 
    <transport clientCredentialType="Windows" proxyCredentialType="None" /> 
</security> 

か...

<security mode="TransportCredentialOnly"> 
    <transport clientCredentialType="Ntlm" /> 
</security> 

行動:

<behavior name="behavior_WSS"> 
    <clientCredentials> 
    <windows allowedImpersonationLevel="Impersonation" allowNtlm="true" /> 
    </clientCredentials> 
</behavior> 

または

<windows allowedImpersonationLevel="Delegation" allowNtlm="true" /> 
+1

この質問は、SharePointへのWCFサポートを追加CodePlexの上のプロジェクトがありServerFaultの、COM – Jazza

+1

に適しかもしれません。 http://spwcfsupport.codeplex.com/ – Hameds

答えて

1

あなたはthe things suggested hereを試してみましたか?

例えば、コード内:

proxy.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonation.Impersonate; 
// AllowNtlm = false; 
+1

私は偽装のように多くの組み合わせを試してきました/ ntlm ..時間を髪を引っ張って、そしてあきらめた。私は、サービスを呼び出すプロセスがすでにWindowsによって認証されていない限り、私が指定することはできないと確信しています。つまり、コード内に特定のサービスアカウントを指定することはできません。 – misteraidan

関連する問題