Quantcast
Channel: Claims based access platform (CBA), code-named Geneva forum
Viewing all articles
Browse latest Browse all 2535

WIF 4.5 : Safe handle has been closed

$
0
0

I have a WCF service with multiple endpoints exposed with different authentication mechanisms, one of them IssuedToken, so I have turned on useIdentityConfiguration in the web.config.

I have an endpoint behavior that loads a parameter inspector for each method, on the BeforeCall I check the OperationContext.Current.ServiceSecurityContext.AuthorizationContext.Properties["ClaimsPrincipal"] so that I can add a custom ClaimsIdentity. (BTW, OperationContext.Current.ClaimsPrincipal is null at this point) Part of this is if it's a WindowsIdentity to grab the .User.Value property (the sid).

I have a sample winforms app that calls the WCF service using a binding that uses SspiNegotiatedOverTransport. I have useIdentityConfiguration set to true.

Here's the problem : I create the generated client (ClientBase) object, I don't use a ChannelFactory. If I make more than one call using the same instance of the client, after the first call and subsequent calls I get the ObjectDisposedException on the WCF service side whenever I access properties on the Identity object off the OperationContext.Current.ServiceSecurityContext.AuthorizationContext.Properties["ClaimsPrincipal"] principal.

What is going on? I'm trying to move to WIF 4.5, this wasn't a problem in WIF 4.0.

Note : This does not happen when using VS Dev server. This also only happens when useIdentityConfiguration is set to true. When it's false, there is no ClaimsPrincipal in the AuthContext but there still is an Identities property that contains a valid ClaimsIdentity.



Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>