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?
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? >
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?