locked
security in wcf services RRS feed

  • Question

  • User1444315574 posted
    hi,
    how to anable the security in wcf services.

    pls give me with examples.
    Thursday, November 21, 2013 7:24 AM

Answers

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 21, 2013 8:11 AM
  • User260886948 posted

    Hi,

    In WCF there are two types of Security modes:

    1.Transport Security  
    The security will be enforced at the transport layer level. This means the transport layer will mask the plain message. Transport Security will help in maintaining the good performance level of the WCF service where as it can’t be used on the service that is hosted on the internet or on a network where there is an intermediate router or any other proxy server. It is best suited for the WCF services hosted on the intranet.

    netTcpBinding has the default security mode as Transport.

    2. Message Security
    The communication message will be encrypted in this case. It is best suited for the WCF services that are hosted and available over the internet.
    wsHttpBinding has the default security mode as Message.

    The below is the sample web.config entry to set the security mode for a particular binding. 

    <bindings>
                    <wsHttpBinding>
                           <binding>
                                 <security mode="Transport/Message"></security>
                           </binding>
                    </wsHttpBinding>
     </bindings>

    For more information, please try to refer to:
    http://www.codeguru.com/columns/experts/top-7-tips-in-securing-your-wcf-services.htm .

    Best Regards,
    Amy Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 22, 2013 2:27 AM

All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, November 21, 2013 8:11 AM
  • User260886948 posted

    Hi,

    In WCF there are two types of Security modes:

    1.Transport Security  
    The security will be enforced at the transport layer level. This means the transport layer will mask the plain message. Transport Security will help in maintaining the good performance level of the WCF service where as it can’t be used on the service that is hosted on the internet or on a network where there is an intermediate router or any other proxy server. It is best suited for the WCF services hosted on the intranet.

    netTcpBinding has the default security mode as Transport.

    2. Message Security
    The communication message will be encrypted in this case. It is best suited for the WCF services that are hosted and available over the internet.
    wsHttpBinding has the default security mode as Message.

    The below is the sample web.config entry to set the security mode for a particular binding. 

    <bindings>
                    <wsHttpBinding>
                           <binding>
                                 <security mode="Transport/Message"></security>
                           </binding>
                    </wsHttpBinding>
     </bindings>

    For more information, please try to refer to:
    http://www.codeguru.com/columns/experts/top-7-tips-in-securing-your-wcf-services.htm .

    Best Regards,
    Amy Peng

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, November 22, 2013 2:27 AM