Ayende @ Rahien

Hi!
My name is Oren Eini
Founder of Hibernating Rhinos LTD and RavenDB.
You can reach me by phone or email:

ayende@ayende.com

+972 52-548-6969

, @ Q c

Posts: 08 | Comments: 18

filter by tags archive

In the authentication maze

time to read 1 min | 180 words

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

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

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

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

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

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

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

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

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

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.

Comment preview

Comments have been closed on this topic.

FUTURE POSTS

  1. Concurrent max value - 2 hours from now
  2. Production postmortem: The case of the memory eater and high load - 3 days from now
  3. Production postmortem: The case of the lying configuration file - 4 days from now
  4. Production postmortem: The industry at large - 5 days from now
  5. The insidious cost of allocations - 6 days from now

And 5 more posts are pending...

There are posts all the way to Sep 10, 2015

RECENT SERIES

  1. Find the bug (5):
    20 Apr 2011 - Why do I get a Null Reference Exception?
  2. Production postmortem (10):
    14 Aug 2015 - The case of the man in the middle
  3. What is new in RavenDB 3.5 (7):
    12 Aug 2015 - Monitoring support
  4. Career planning (6):
    24 Jul 2015 - The immortal choices aren't
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats