WindowsフォームサービスでWCFサービスに接続できますが、Windowsサービスではできません。 System.Security.Authentication.InvalidCredentialException:クライアントの資格情報を拒否した サーバー私はそれが次のエラーサーバーがクライアントの資格情報であるWCFをWindowsサービスとして拒否しました
サーバがクライアントの資格情報
内部例外を拒否したスロープロキシへ)(暖炉たび。
---> System.ComponentModel.Win32Exception:ログオンに失敗しました
---内部例外スタックトレースの終わり--- System.Net.Security.NegoState.ProcessAuthenticationで
(LazyAsyncResult lazyResult)
でSystem.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredentialの 資格、でChannelBinding結合、文字列ターゲット名、のProtectionLevel requiredProtectionLevel、TokenImpersonationLevel allowedImpersonationLevel)
System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredentialの 資格、文字列ターゲット名に、プロテクトしたがって、System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgradeでionLevel requiredProtectionLevel、TokenImpersonationLevel allowedImpersonationLevel)
(ストリーム ストリーム、SecurityMessageProperty & remoteSecurityは)
ソリューションを探してみましたが、どれも私の要件を当てはめません投稿されました。
助けてください...
更新1: A.R @
、試してみました
client.ClientCredentials.Windows.AllowedImpersonationLevel =
System.Security.Principal.TokenImpersonationLevel.Impersonation;
を使用したが無駄に。
アップデート2:
WCFサービスの設定は
<system.serviceModel>
<diagnostics performanceCounters="All" />
<bindings>
<netTcpBinding>
<binding name="myBindingForLargeData" maxReceivedMessageSize="5242880" maxConnections="10">
<readerQuotas maxDepth="64" maxStringContentLength="5242880" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="WCFService.ServiceBehavior"
name="WCFService.CollectorService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="myBindingForLargeData"
name="netTcpEndPoint" contract="WCFService.ICollectorService" />
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
name="mexTcpEndPoint" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8010/WCFService.CollectorService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="WCFService.ServiceBehavior">
<serviceMetadata httpGetEnabled="False"/>
<serviceDebug includeExceptionDetailInFaults="True" />
<serviceThrottling
maxConcurrentCalls="32"
maxConcurrentSessions="32"
maxConcurrentInstances="32"
/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
質問が更新されました – Bravo
を確認してください。偽装する相手を実際に教えてください。フラグを設定して魔法のように偽装することはできません。 2番目のリンクにある資料を読んでください。 –