Need to set username and password in web.config for ISA Proxy for WCF client


Andrew Jocelyn


I need to explicity set a username and password in the web.config file of a
SharePoint server to use a ISA proxy server. Aparantly the ISA server won't
accept credentials if they are not the currently logged on user. Real code
examples needed please.

<binding name="ServiceSoap"
<readerQuotas maxDepth="32" maxStringContentLength="8192"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"
<endpoint address="http://endpoint/service.asmx"
binding="basicHttpBinding" bindingConfiguration="ServiceSoap"
contract="Service.ScsServiceSoap" name="ServiceSoap"/>

This doesn't work if useDefaultWebProxy is true in the basicHttpBinding.

<proxy usesystemdefault="True" proxyaddress=http://localhost:8888 />

Many thanks



Steven Cheng

Hi Andrew,

From your description, I understand that you have a sharepoint server which
contains some code that invoke a remote WCF service. And since the WCF
service is accessed through a ISA proxy, you're wondering how to specify
the username/password credentials for the ISA proxy's authentication,

If so, I think the problem here is that web.config(or app.config) file only
contains the proxy address info(such as whether use system default one or
your cusotm proxy address). There is no configuration entry for you to
supplyl the authentication credentials for proxy.

For your case, I've also handled a former issue with the similar scenario.
In WCF if you need to perform authentication against a proxy server, and
the credentials for the proxy server authentication is different from your
WCF client's process account(security context), you might consider using
the following means:

1. still set the <> and WCF <binding> useDefaultWebProxy to true.
In such cases, the WCF runtime will retrieve proxy info from the
"WebRequest.DefaultWebProxy" static property. Thus, you can supply a
custom WebProxy object at your application's initial stage(with
authentication credentials ). e.g.

//before your WCF method call executes

WebProxy wproxy = new WebProxy("new proxy",true);
wproxy.Credentials = CredentialCache.DefaultNetworkCredentials;// or you
can construct a custom NetworkCredential from username/password

WebRequest.DefaultWebProxy = wproxy;


here is the former thread which mentioned details on this:

#WCF Proxy Server settings not working - cmuelle


Steven Cheng

Microsoft MSDN Online Support Lead

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

Get notification to my posts through email? Please refer to

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question