मैं> बजाय नेटवर्क सेवाओं की पहचान आवेदन पूल करने के लिए एक सक्रिय निर्देशिका उपयोगकर्ता जोड़कर इस संकल्प लिया। यह उपयोगकर्ता ऐसे समूह में भी है जिसके पास प्रॉक्सी सर्वर के माध्यम से इंटरनेट ब्राउज़ करने की अनुमति है। इस उपयोगकर्ता को क्लाइंट होस्ट सर्वर पर IIS_WPG समूह में भी जोड़ें।
पहले बिट के नीचे दिए गए कोड में ग्राहक को डब्ल्यूसीएफ सेवा के साथ प्रमाणीकृत करें। दूसरी बात यह है कि क्रेंडेंशियल को आंतरिक प्रॉक्सी सर्वर पर पास करना है ताकि क्लाइंट डीएमजेड सर्वर पर डब्ल्यूसीएफ सेवा को कॉल कर सके। लेकिन मुझे नहीं लगता कि प्रॉक्सी भाग काम करता है। मैं वैसे भी कोड छोड़ रहा हूँ।
// username token credentials
var clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = ConfigurationManager.AppSettings["Client.Mpgs.Username"];
clientCredentials.UserName.Password = ConfigurationManager.AppSettings["Client.Mpgs.Password"];
proxy.ChannelFactory.Endpoint.Behaviors.Remove(typeof(ClientCredentials));
proxy.ChannelFactory.Endpoint.Behaviors.Add(clientCredentials);
// proxy credentials
//http://kennyw.com/indigo/143
//http://blogs.msdn.com/b/stcheng/archive/2008/12/03/wcf-how-to-supply-dedicated-credentials-for-webproxy-authentication.aspx
proxy.ChannelFactory.Credentials.Windows.ClientCredential = new System.Net.NetworkCredential
(
ConfigurationManager.AppSettings["Client.ProxyServer.Username"]
, ConfigurationManager.AppSettings["Client.ProxyServer.Password"]
, ConfigurationManager.AppSettings["Client.ProxyServer.DomainName"]
);
मेरी web.config में मैं निम्नलिखित का इस्तेमाल किया है,
<system.net>
<defaultProxy useDefaultCredentials="true">
<proxy usesystemdefault="True" proxyaddress="http://proxyServer:8080/" bypassonlocal="False" autoDetect="False" /> </defaultProxy>
</system.net>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ITest" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" proxyCredentialType="None" realm=""/>
<message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://wcfservice.organisation.com/test/test.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITest" contract="Test.Test" name="WSHttpBinding_ITest"/>
</client>
</system.serviceModel>
ऊपर कोड अपने स्थानीय मशीन से काम करता है। जब मैं एक dev सर्वर पर कोड अपलोड करता हूं तो यह काम नहीं करता है। मैंने प्रॉक्सी सर्वर लॉग को देखा और यह नीचे दिखाता है,
2011-06-14 05:21:10 2 11.11.11.11 - प्रमाणीकरण_फेल किया गया "संगठन/वित्त" - 407 टीसीपी_DENIED कनेक्ट - टीसीपी wcfservice.organisation.com 443/- - - 11.11.11.11 612 161 -
2011-06-14 05:21:10 6 11.11.11.152 सर्वर नाम $ - अनुमति नहीं दी गई policy_denied "संगठन/वित्त" - 403 TCP_DENIED कनेक्ट - टीसीपी wcfservice.organisation.com 443/- - - 11.11.11.205 185 361 -
हमारे स्मार्ट सिस्टम व्यवस्थापक DF आवेदन पूल करने के लिए एक सक्रिय निर्देशिका उपयोगकर्ता जोड़ा> बजाय नेटवर्क सेवाओं की पहचान। यह उपयोगकर्ता ऐसे समूह में भी है जिसके पास प्रॉक्सी सर्वर के माध्यम से इंटरनेट ब्राउज़ करने की अनुमति है। इस उपयोगकर्ता को क्लाइंट होस्ट सर्वर पर IIS_WPG समूह में भी जोड़ें।
यह मेरे लिए काम किया।
स्रोत
2011-06-15 07:01:23
यह एनटीएलएम प्रॉक्सी के लिए काम नहीं कर रहा है। मुझे इसे काम करने के लिए 'क्लाइंट। क्लाइंट क्रेडेंशियल। विन्डोज़' भरने की ज़रूरत थी। –
यह एक चैनल प्रमाण-पत्र है, न कि http प्रॉक्सी प्रमाण-पत्र –
@aloneguid डब्लूसीएफ में बहुत यकीन है कि यह डबल ड्यूटी करता है। हाँ, यह पागल है। –