Windows 認証を使用して IIS で WCF Web サービスをホストしようとしています。制限により、basicHttpBinding と偽装を使用する必要があります (チェーンのリソースにアクセスするために、呼び出し元の ID を偽装します)。
WCF サービスの操作コントラクトで偽装を宣言的に有効にしました。
[OperationBehavior(Impersonation = ImpersonationOption.Required)]
私のweb.configは次のとおりです。
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="basic">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows">
</transport>
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="NotesService">
<endpoint address="http://Client1.osp.local:15000/NotesService/NotesService.svc" bindingConfiguration="basic" binding="basicHttpBinding" contract="NotesService.ServiceContract.INotesService">
<identity>
<servicePrincipalName value="HTTP/Client1.osp.local:15000"/>
</identity>
</endpoint>
</service>
</services>
</system.serviceModel>
ただし、アクティベーション エラーが発生します。私は何が欠けていますか?
私が得ているエラーは次のとおりです。
The contract operation 'Process' requires Windows identity for automatic
impersonation. A Windows identity that represents the caller is not provided by
binding ('BasicHttpBinding','http://tempuri.org/') for contract
('NotesService','http://tempuri.org/'.