Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Fri, 8 Feb 2008 16:39:49 -0800 (PST),    group: microsoft.public.dotnet.security        back       


WCF SecurityContext with many clients   
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?
date: Fri, 8 Feb 2008 16:39:49 -0800 (PST)   author:   Pedro Ciarlini

Re: WCF SecurityContext with many clients   
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,
> 
> 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?
>
date: Sat, 9 Feb 2008 06:27:11 +0000 (UTC)   author:   Dominick Baier

Re: WCF SecurityContext with many clients   
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
 wrote:
> 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,
>
> > 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?
date: Sat, 9 Feb 2008 04:46:03 -0800 (PST)   author:   Pedro Ciarlini

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us