i am trying to achieve username/password authentication using Basic as security mode in my config file. i have a requirement to make my service available on HTTP so HTTPS is not an option. The other requirement that i have is that the client should be authenticated
(from a database so Windows authentication is not an option) using username and password that he will provide.
following is the code:
A class added in the service project:
public class ServiceValidator : UserNamePasswordValidator
public override void Validate(string userName, string password)
// This isn't secure, though!
if ((userName != "mohsin") || (password != "mohsin"))
throw new SecurityTokenException("Validation Failed!");
my service.config looks like this
View Complete Post