Search code examples
c#wcfwcf-binding

WCF PrincipalPermission opertaion properties not working


I am trying to add this property to my operation. i am using Basic authentication on IIS over basic http binding. but i keep getting access denied.

[PrincipalPermission(SecurityAction.Demand, Name = "username")]

do i need to add domain name as well?


Solution

  • from MSDN, If the authentication provider is Windows NT, Name is the same as the user's Windows NT login name (in the form "DomainName\UserName"). Check the documentation for the host to determine which authentication provider it uses and how it determines the identity of the current principal.