Ayende @ Rahien

Refunds available at head office

In the authentication maze

image

Well, it looks like I have once again managed to put myself in a tricky spot. I have the following scenario:

  • Domains: A1 & A2 - no trust or any association between the two.
  • A user access a Website on A1, using windows authentication, which makes a web service call to a machine on domain A2 (anonymous security, at the moment).
  • As a result of the web service call, the machine on A2 needs to make another web service call to A1, and it needs to do it with windows authentication, with the credentials of the original user.

Now, I have control on the machine in A1 (.Net 1.1 ASMX WebServices) and I can do whatever I want to the machine in A2 (WCF). No trust between the domains, as I said, so I don't think that I can make Windows Authentication works between the two. Frankly, I don't care about authenticating users, I just need their credentials when I am going back to the machine in A1.

Any suggestions?

Comments

shawn
08/26/2007 06:05 PM by
shawn

I tend to use soapheaders that contain kerberos tickets for this sort of thing. A simple base class-esque piece of functionality and all of your web services can be smart enough to pass it along when it's present.

Ayende Rahien
08/26/2007 07:11 PM by
Ayende Rahien

I don't control the final WS, that is Window Auth only.

The control the first and second WS (ASMX and WCF, respectively)

shawn
08/26/2007 07:16 PM by
shawn

fair enough, but in that scenario, unless i'm missing something, you could simply convert your kerberos ticket into standard windows credentials and pass them along to the final servicepoint.

Ayende Rahien
08/26/2007 07:41 PM by
Ayende Rahien

Assume that I am ignorant about this, can you point me to a code sample about this?

Morgan
08/26/2007 07:44 PM by
Morgan

Since the user is identified with windows authentication on the website, I cant see how the website can pass the user credentials to the webservice on A2 in a usable way for A2 to call the webservice on A1. Windows authentication works from point-to-point only.

James Kovacs
08/26/2007 10:51 PM by
James Kovacs

You could make this work using Kerberos and Protocol Transition.

http://msdn2.microsoft.com/en-us/library/ms998355.aspx

The website on A1 would need to pass some identifier to A2. When A2 called back, A1 could use any method to authenticate the incoming call and then use Protocol Transition to get a Kerberos ticket for the original user.

@Morgan - Windows auth hides two different protocols - NTLM (older) and Kerberos v5 (newer). NTLM is point-to-point and cannot perform multi-server hops. Kerberos can perform multi-server hops. The default is Kerberos if you're in a Win2K or higher domain and all clients/servers understand Kerberos.

Ayende Rahien
08/27/2007 04:35 AM by
Ayende Rahien

James,

I control the first and second services, but not the final one.

That is a standard Windows Auth ASMX service. Would it still work?

James Kovacs
08/27/2007 04:53 AM by
James Kovacs

You need to run some code in the A1 domain to perform the protocol transition. It would work if you could interpose yourself between A2 and the callback into the standard Windows Auth ASMX service in A1 (or SWAASA1 for short). It could be a web service you control that could then call the SWAASA1 or a HttpModule installed in the SWAASA1's pipeline.

Comments have been closed on this topic.