We are using UserNamePasswordValidator
and an IAuthorizationPolicy
to load custom role data into an IPrincipal
object for authentication and some business level rights on our server side.
Thus, we are using Thread.CurrentPrincipal
inside our service operations to test rights etc. At the risk of getting more technical than I should, this is a static
property on the Thread
class which means that it has instance scope global scpope (duh, thanks Thilak). Should I change my InstanceContextMode
in future for performance reasons to Single
, this scheme will surely break? I am aware that Single
requires you to write thread-safe code so in itself isn't just a config change.
Would you also please share any links to authoritative texts on exactly what kind of instance load WCF should be able to handle before I need to concern myself with this problem?