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 / .NET Framework / Security / February 2008

Tip: Looking for answers? Try searching our database.

WCF SecurityContext with many clients

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pedro Ciarlini - 09 Feb 2008 00:39 GMT
Hi all,

I'm without ideas to fix this problem...

Scenario:
- One WCF Service
   * ( using "ServiceBehavior(InstanceContextMode =
InstanceContextMode.PerSession)]" )
- Many WCF clients, with windows integrated authentication;
- The service must know the client login name;
   * This is necessary for authorization purposes;
   * The property
"OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name"
works at a first moment;

Problem (sequence):
// having login_name =
OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name;

1) Client1 calls a service method (Debug: the login_name is 'user1' -
ok);
2) Client1 enters on a FaultState (for any reason);
3) Client2 calls a service method (Debug: the login name is
login_name is 'user2' - ok);
4) Client1 creates a new client;
5) Client1 calls a service method (Debug: the login name is
login_name is 'user2' - NOT OK);

Anybody?
Dominick Baier - 09 Feb 2008 06:27 GMT
you are talking about physically separated clients? any chance you are sharing
the channel factory or the proxy between the 2 clients??

-----
Dominick Baier (http://www.leastprivilege.com)

Developing More Secure Microsoft ASP.NET 2.0 Applications (http://www.microsoft.com/mspress/books/9989.asp)

> Hi all,
>
[quoted text clipped - 23 lines]
> login_name is 'user2' - NOT OK);
> Anybody?
Pedro Ciarlini - 09 Feb 2008 12:46 GMT
Shame on me...

I found the problem yesterday, and is exactly this, Dominick. A #$$%@#
static property on my client was sharing the same channel.

My bad. Thanks!

On 9 fev, 03:27, Dominick Baier
<dbaier@pleasepleasenospam_leastprivilege.com> wrote:
> you are talking about physically separated clients? any chance you are sharing
> the channel factory or the proxy between the 2 clients??
[quoted text clipped - 31 lines]
> > login_name is 'user2' - NOT OK);
> > Anybody?

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.