Is this in a firewall scenario inside the network / behind?
, netTcp ( ) Windows. Windows WCF.
, - , :
[PrincipalPermission(SecurityAction.Demand, Role = "Administrators")]
[PrincipalPermission(SecurityAction.Demand, Name = "JohnDoe")]
public void YourSensitiveMethod();
WindowsIdentity , :
if(ServiceSecurityContext.Current.WindowsIdentity != null)
{
WindowsPrincipal principal = new WindowsPrincipal(ServiceSecurityContext.Current.WindowsIdentity);
if(!principal.IsInRole("Administrators")
{
return; // or throw a FaultEXception or something
}
}
?
UPDATE: , WCF , WCF Codeplex. ( !) .
netTcpBinding Windows :
<bindings>
<netTcpBinding>
<binding name="SecuredByWindows">
<security mode="Transport">
<transport clientCredentialType="Windows"/>
</security>
</binding>
</netTcpBinding>
</bindings>