SILVERLIGHT3 Series (ii) silverlight3+wcf+ custom username without using a certificate

Source: Internet
Author: User

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;
         }
     }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.