Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allowing a User to access .Net WCF service using Windows Authentication mode and Message Level security

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.

like image 743
Sandeep Dsouza Avatar asked Jan 06 '12 14:01

Sandeep Dsouza


People also ask

How do I provide security to WCF?

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.

Which of the security modes are supported in WCF?

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" ...


1 Answers

You can do this in your web.config:

<system.web>
    <authentication mode="Windows" />
    <authorization>
        <allow users="DOMAIN\user1" />
        <deny users="*" />
    </authorization>
</system.web>
like image 171
Didaxis Avatar answered Oct 16 '22 18:10

Didaxis