I am trying to work out why attribute based security isn\'t working as I\'d expect in WCF and I suspect it might have something to do with the following:
AppDoma
I admit it's a rather ugly workaround, but if all else fails you could replace:
principal = (WindowsPrincipal)Thread.CurrentPrincipal;
with something like
principal = new WindowsPrincipal(new WindowsIdentity(Thread.CurrentPrincipal.Identity.Name));
If that doesn't work, it will probably at least be instructive in showing where things are going wrong.
But I can't imagine it failing, since it does exactly the same thing (where it is relevant) as the line that worked: I assume Thread.CurrentPrincipal.Identity.Name
is "ksarfo"
.