The wrong Principal is passed to my remoted object

Hi there,

This article:http://blogs.msdn.com/manishg/archive/2005/04/22/410879.aspx#436192
helped me a lot when trying to impersonate my user to my remote object. But... when I try to access my remoted server object from a web application, the wrong principal is passed.

I've got a web forms application authenticating against ADAM, so when i'm logged in to the web site theHttpContext.Current.User.Identity =the ADAM user I'm logged into the website with. When I start a method on the remoted object, theThread.CurrentPrincipal.Identity =the AD User I'm logged in to Windows with.... Of course I want to identify as the same user on both places.

Any suggestions?

Bart

[917 byte] By [BartCoppens] at [2008-3-6]
# 1
What is the value of Thread.CurrentPrincipal.Identity on your website?
douglasp at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
Hi,

On the website (client):
HttpContext.Current.User.Identity = the ADAM user I'm logged into the website with
Thread.CurrentPrincipal.Identity =
the ADAM user I'm logged into the website with

In the remote object (server):
Thread.CurrentPrincipal.Identity = the AD User I'm logged in to Windows with

I'm lost....

Bart

BartCoppens at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
Is the Thread.CurrentPrincipal an instance of WindowsPrincipal?
douglasp at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 4
I suspect that the ADAM identity is not a WindowsPrincipal.

Remoting only flows WindowsPrincipals unless you do something work yourself.

Open a new thread if this is not the case.

douglasp at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 5
Hi,

After being in the hospital I had a time to look if the ADAM identity is a WindowsPrincipal. It is not, indeed, it is a System.Security.Principal.GenericPrincipal and the identity is a System.Web.Security.FormsIdentity.

How do I flow my ADAM (Generic)Principal using remoting?

Bart

BartCoppens at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified