Search code examples
wcfwcf-securitybasic-authentication

Implementing Basic Authentication in WCF


I've a requirement to implement basic authentication in WCF but the user credentials are stored in database instead of Active Directory. So whenever a client call my service method I've to get the username & password from the SOAP headers and authenticate using database. Can any body point out some good references to implement this?

Note: The service is using basic-http binding.


Solution

  • What are you really want to use? You are combining multiple authentication strategies together because Basic authentication usually refers to Basic HTTP authentication and it doesn't use SOAP header. It uses HTTP header.

    If you want to use Basic HTTP authentication your choices differ by hosting type:

    If you want to use authentication based on SOAP header you can again use custom password validator.