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 2004

Tip: Looking for answers? Try searching our database.

Sending the WindowsPrincipal object

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Johan Johansson (Sweden) - 09 Nov 2004 13:48 GMT
I am writing a webService that is going to be accessed anonymously (I don't
want to "configurable" depend on windows integrated authentication). But I
still want to authenticate the client (or rather the user using the client).

Because of this I want to send the WindowsPrincipal from the client to the
webService in the SoapHeader. I don't want to send the credentials (userName,
password and domain) because I want the client to be unaware of what account
it runs at and since there may be several client applications (UIF
applications, not ASP.Net applications) I don't want to make the user logon
into each UIF.

The idea is to let user logon to his/her computer and start the UIF
applications. This client app (consumer of webService) gets the current
WindowsPrincipal, serializes it (into a byte array using the BnaryFormatter),
encrypts it and sends it to the webService. The webService in turn decrypts
the message, deserialize the WindowsPrincipal and impersonates it.

That's the idea, and it is quite successfull up until the point where I try
to deserialize the WindowsPrincipal. It throws an exception saying "Invalid
token : it cannot be duplicated".

Obviously it is possible to send the WindowsPrincipal since Windows
Integrated Authentication does just that. So, is there a trick to
(de)serialization that I'm unaware of or is this object just not sendable by
anyone not in access of Microsoft specific mechanisms in the OS or the .Net
framework?
Morten Abrahamsen - 10 Nov 2004 14:08 GMT
Hello Johan,

First of all it's not possible to send a WindowsPrincipal object accross machines. A principal is a local object.

What you could do though is to use Integrated Security with IIS. (you configure the current credentials on the WS proxy.)

Then Windows will take care of it for you. You can enable impersonation in ASP.NET as well.

Best of luck,

Morty

> I am writing a webService that is going to be accessed anonymously (I
> don't  want to "configurable" depend on windows integrated
[quoted text clipped - 24 lines]
> sendable by  anyone not in access of Microsoft specific mechanisms in
> the OS or the .Net  framework?

Rate this thread:







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.