SILVERLIGHT3 Series (ii) silverlight3+wcf+ custom username password validation without using a certificate
Let's talk about my needs first.
System Requirements:
The system is an e-commerce platform that can provide information on the display, purchase and trading (trading future considerations). In fact, and Taobao is the same, the difference is that Taobao is a comprehensive category, what products are on, we are an industry, vertical.
Technology selection:
Silverlight3
Wcf
MS SQL
Functional Requirements:
Clients can access directly through HTTP, do not need to use HTTPS, and do not need to install certificates. Our WCF services do not want to be directly exposed to the Internet, but do not use HTTPS access, nor certificate validation, because most of the information is browsed, the future transaction part must be HTTPS, or even the need to install the certificate, currently do not need these.
Design
Myvalidator Class Code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IdentityModel.Tokens;
using System.IdentityModel.Selectors;
namespace WcfService
{
public class MyValidator:UserNamePasswordValidator
{
private string _userName;
public string UserName
{
get { return _userName; }
}
private string _password;
public string Password
{
get { return _password; }
}
public override void Validate(string userName, string password)
{
this._userName = userName;
this._password = password;
}
}
}