Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

HELP! WSE Token Manager calling another webservice

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jbijleveld@gmail.com - 01 Nov 2005 21:40 GMT
Hi,

At this moment I'm involved in a softwaredevelopment project and we are
experiencing a difficult problems. I really hope that anyone can help
us to solve it, since we are working on a deadline and this keeps us
from releasing our product, which is crucial for our organization.

I'll explain our situation:

Our solution exists of three parts:
1. We have a Windows Forms application, which is the client.
2. There is our Processing Webservice, which uses WebService
Enhancements 2 SP3 (WSE) and SSL.
3. Finally we have our Authentication webservice, which is a completely
different website, running on the same webserver, this also uses SSL
but no WebService Enhancements.

HOW IT SHOULD WORK:
This client app (1) has to exchange information with the Processing
webservice (2). The client will send an X509 client certificate to the
webservice to authenticate itself. The request passes through a WSE
Token Manager class, which retrieves the client certificate from the
request. The token manager will then initiate a connection to the
authentication webservice (3) and passes the X509 client certificate to
that webservice.

The authentication webservice does not use a token manager but just
gets the client certificate from the connection and returns the list of
roles for the user owning this certificate. The Processing webservice
(2) uses the set of roles to create a principle for the client app.
When that's done properly, the actual webmethod will be invoked on the
Processing webservice.

DESCRIPTION OF OUR PROBLEM:
The communication between the Processing webservice and the
authentication webservice does not work properly. The authentication
webservice can be called directly from Internet Explorer but if we call
it from our WSE Token Manager, it we get a timeout or a 403 Access
Denied message. Since this is a crucial part of the solution, we need a
real solution as fast as possible!

OUR CONFIGURATION:
All software is currently installed on a Windows XP computer, in
production this will all be hosted on a Windows 2003 server. We are
using IIS5, .NET Framework v1.1 and WSE is installed. Each webservice
is installed as a new Application within IIS, they all use Forms
authentication and they all have Directory Security set to Anonymous
and Windows Integrated Security is disabled for them. Each webservice
had Require Certificates checked.  All Web applications are working
under the standard anonymous user account IUSR...  with no special
permissions.
A valid SSL Certificate is installed and SSL works fine with a browser,
which asks the user to select a certificate and then properly shows the
list of webmethods.
On disk, the IUSR account was granted Full Control permission on the
files of both sites.

OUR ANALYSIS UPTO NOW:
The client calls the Processing webservice and we think it will be
authenticated as IUSR since the Processing webservice runs under the
IUSR account. So if the token manager calls out to the authentication
webservice, it should do so under that identity. The token manager can
properly extract a client certificate object from the SOAP context (of
the request if we pass it in the ClientCertificates collection).

The webservice calls the authentication webservice using an url that
starts with https and it adds the retrieved client certificate to the
webservice proxy, before making the call. When the authentication
webservice is called, the webmethod is never reached (we see no logging
messages).

What really happens when the client calls the Processing webservice, is
that we see a "Audit Failed" message in the Event Log, telling us that
IUSR account cannot login since it does have permission for login type
3. It indicates that this message comes from the iis proces. Type 3
seems to be the right to "Log on Locally" for as far as I can find. Can
anyone tell me what this exactly means?

It looks like the IUSR account can not make a proper call to another
webservice since if we have the Processing webservice run under a local
administrators account, it can make that call. In that case, the
Authentication webservice will be called and no Audit Failure is
reported. This also happens when using Impersonation (which is as
expected since the active user is local admin). It looks like some
impersonation as IUSR happens under the hood.

Although we can call the authentication webservice (when impersonated),
it does not work yet since it seems that IIS rejects the webmethod call
with a 403 error or a timeout. We expect that IIS does that because we
still see no logging.

SUMMARY:
In short, we determine two problems:
- calling the Processing webservice fails if it runs under the IUSR
account
- If we use another account, the token manager still fails to call the
authentication webservice.

I really hope that anyone will take the time to think with me what I'm
missing since at this point, I have no clue on how to solve this.

Thanks very much in advance for any suggestions!

Sincerely,

Jeroen Bijleveld
The Netherlands
JB - 02 Nov 2005 16:32 GMT
Today is a good day since we found the cause of the problems!

It is very well described in the following article
http://blogs.msdn.com/kevinha/archive/2005/02/15/373254.aspx

The problem is that the client, who owns the private key of the
certificate, sends a request to the webservice, passing the
certificate.Then, the webservice wants to pass that certificate to
another webservice but the webservice does NOT have its private key.

Therefore the webservice cannot add the certificate to the request and
the authentication webservice will never receive a certificate. That is
why the second webservice will return an error 403 (Access denied),
More specifically it returns a 403.7 telling us that no client
certificate was supplied.

To solve this we had two options:

First option:
Install the client certificate in the Local Computer\Personal
certificate store on the server hosting the processing webservice. The
certificate must be installed there WITH its private key AND the ASPNET
account (on Windows XP) must be granted the permission to access that
certificate.
We grant the permission using the X509 Certificate Tool from the
WebService Enhancements 2 installation.

That scenario works but is not practical in real deployment scenario's.
However, doing so helped us to determine the real cause of the problem.

Our second option:
The WSE Token manager of the Processing webservice gets the certificate
from the client and then gets its content as a byte array. That byte
array is then passed to the authentication webservice as an extra input
parameter. The Authentication webservice uses the byte array to restore
a real certificate object (ofcourse without the private key) and uses
that to authenticate the user.

The Processing webservice CAN use its own certificate to authenticate
itself to the Authentication webservice. If the authentication
webservice is then set to require a certificate it's more secure.

I hope this article will help you in your development efforts and save
you some of the time we invested in investigating our problem.

Sincerely,
Jeroen Bijleveld

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.