473,738 Members | 3,854 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Forbidden with client authentication scheme 'Anonymous'

I am trying to build a proof of concept of a WCF service utilisting a
wsHttpBinding with Transport Certificate security. I am having problems
connecting to it with a console client - everytime I try to open the channel
I get the following error: Forbidden with client authentication scheme
'Anonymous'
InnerException: The remote server returned an error: (403) Forbidden

I have taken the following steps to set up the server:
* Acquired a verisign certificate registered to the machines dns address
* Installed the certificate into the certificate stores (CurrentUser and
LocalMachine) under Personal and Trusted People
* Used Httpcfg to setup the following port with SSL :
IP : 0.0.0.0:7000
Hash : fb29ea4bdb5378b 2cc 2f1f7ece056dd48 8db47c
Guid : {00000000-0000-0000-0000-000000000000}
CertStoreName : MY
CertCheckMode : 0
RevocationFresh nessTime : 0
UrlRetrievalTim eout : 0
SslCtlIdentifie r : (null)
SslCtlStoreName : (null)
Flags : 2
------------------------------------------------------------------------------

* Created a console application with a very simple WCF service contract and
the following configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.service Model>
<behaviors>
<serviceBehavio rs>
<behavior name="NewBehavi or">
<serviceMetadat a httpsGetEnabled ="true" />
<serviceCredent ials>
<clientCertific ate>
<authenticati on certificateVali dationMode="Pee rOrChainTrust"/>
</clientCertifica te>
</serviceCredenti als>
</behavior>
</serviceBehavior s>
</behaviors>
<bindings>
<wsHttpBindin g>
<binding name="Binding">
<security mode="Transport ">
<transport clientCredentia lType="Certific ate"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service behaviorConfigu ration="NewBeha vior"
name="WcfSelfHo stedPOC.TestSer vice">
<endpoint address="https://servername:7000/TestService"
binding="wsHttp Binding"
bindingConfigur ation="Binding" name="TestServi ce.Http"
contract="WcfSe lfHostedPOC.ITe stService" />
<host>
<baseAddresse s >
<add baseAddress="ht tps://servername:7000/TestService"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceM odel>
</configuration>

* Created a console client with the following configuration file:
<?xml version="1.0" encoding="utf-8" ?>
<configuratio n>
<system.service Model>
<bindings>
<wsHttpBindin g>
<binding name="TestServi ce.Http" >
<security mode="Transport ">
<transport clientCredentia lType="Certific ate"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://servername:7000/TestService"
binding="wsHttp Binding"
bindingConfigur ation="TestServ ice.Http"
contract="Servi ceReference1.IT estService"
name="TestServi ce.Http" />
</client>
</system.serviceM odel>
</configuration>

And a simple client with the following code:
static void Main(string[] args)
{
ServiceReferenc e1.TestServiceC lient client = new
WcfSelfHostedPO CClient.Service Reference1.Test ServiceClient() ;

client.ClientCr edentials.Clien tCertificate.Se tCertificate(St oreLocation.Cur rentUser,
StoreName.My,
X509FindType.Fi ndByThumbprint,
"fb 29 ea 4b db 53 78 b2 cc 02 f1 f7 ec e0 56 dd 48 8d b4
7c");
client.DoWork() ;
Console.WriteLi ne("Yay!");
client.Close();
}

It always falls over with the DoWork() call with the forementioned error. I
have checked in the debugger and and the referenced certificated was loaded
correctly.

The same service worked with Basic authentication enabled and I can access
the metadatapage if I specify the nominated certificate through the browser.
I can also add a service reference from the client project.

Have I missed anything?

Many thanks,
--
Tim Eckersley
Jun 27 '08 #1
0 2831

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2431
by: Joey Edelstein | last post by:
Hi, We are trying to add a Client Certificate support for our web app that emulates a hardware device web app. The hardware uses a 2 factors authentication, which requires a Web Service client to send: Client Certificate and Username / password. We are using a Web Service provider which uses IIS 5.1 as HTTP server. IIS is set to require client certificate and Basic Authentication.
9
2507
by: Tom B | last post by:
In my web.config file I've specified Windows for the authentication, in IIS I've set it to Integrated Authentication. But my SQL connection is still showing Anonymous. Is there somewhere else I need to check? Thanks Win 2003, SQL Server 2000
8
5046
by: trinitypete | last post by:
Hi all I have a strange problem with IIS windows pass through authentication. Heres the setup IIS running with Windows Authentication for our intranet site. ACL has been set to everyone for all web directories. This is all on a windows 2003 server. We add the intranet site to the intranet zone so the windows credentials will automatically get passed to IIS 90% of the time it works fine, but Intermittently we get access forbidden -...
1
2465
by: John Yung | last post by:
Hi, I have a client (C# MS Excel Project) calling a Web Service to retrieve and update data. One of the business requirement is the client's NT Login ID, IP Address and computer name must be log for each web service method call. To get client information using integrated Windows authentication with ASP.NET client. You need to disable "Anonymous Access" and enable "Integrated Windows authentication". IE will automatically pass in the...
5
11079
by: Jared | last post by:
Hi I am trying to get the Windows username and PC name from the client PC in VB or c#. I am using 'forms' authentication and 'anonymous access' in IIS. Is it possible to get the client PC's windows username and Computer Name whilst using this combination? Access levels to various pages are stored in an SQL Server table
6
6807
by: Hao | last post by:
There is a wield issue in inspecting the network traffic on the web service client side. There are two soap calls if credentials are used. The first call has no credentials and is rejected by the server. The second call has credentials and works. They are done by .Net behind the scene. No exception is generated. If I do not pass in credentials or pass in empty crenditials (empty user id and password), only one soap message is sent. I...
4
3944
by: Remote_User | last post by:
Hi, When I create a WCF client (hosting the service is fine) and the service on the same machine everything works is good. But when I want to have the client on a different machine this fails. How can I generate the client on a different machine ? Also it failed even when I specified the IP (starting the service takes the address in the form of http://localhost:port_num/......) of the hosting machine in the base address section of the...
3
12480
by: mzarlenga | last post by:
I have a client / server written in C#/VS2005 that uses WCF. Each component exposes a secure (https:) endpoint with WCF. httpcfg was used to secure the ports with certificates. (Both system use the same certificate for their endpoints, in case that matters) The client and server are on different physical systems. The applications communicate like so: Request: Client -----Server's endpoint ( https://172.16.26.30:8283/MyServer )
1
5669
by: whitemice | last post by:
The only documentation regarding doing authentication for XML-RPC I can find is - "Both the HTTP and HTTPS transports support the URL syntax extension for HTTP Basic Authentication: http://user:pass@host:port/path. The user:pass portion will be base64-encoded as an HTTP `Authorization' header, and sent to the remote server as part of the connection process when invoking an XML-RPC method. You only need to use this if the remote server...
0
8968
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8787
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9259
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9208
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6750
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4569
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.