I have a WCF service which is to use windows authentication and message level security.The WCF Service will be an intranet service.
What i have to do is to allow a single user say "domain\user1" to access this service?
I want all other users to be denied access.
To secure an application that runs exclusively on a Windows domain, you can use the default security settings of either the WSHttpBinding or the NetTcpBinding binding. By default, anyone on the same Windows domain can access WCF services. Because those users have logged on to the network, they are trusted.
Windows Communication Foundation (WCF) security has three common security modes that are found on most predefined bindings: transport, message, and "transport with message credential." Two additional modes are specific to two bindings: the "transport-credential only" mode found on the BasicHttpBinding, and the "Both" ...
You can do this in your web.config:
<system.web>
<authentication mode="Windows" />
<authorization>
<allow users="DOMAIN\user1" />
<deny users="*" />
</authorization>
</system.web>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With