none
Membership and WCF Service RRS feed

  • Question

  • As I am a beginner in WCF.

    I would like to turn my web application to use SOA so that users can choose to use a web client, silverlight client or a WPF client.  Currently, I am using custom ASP.NET membership provider so that my authenticate code is like:

     

        protected void LoginControl1_Authenticate(object sender, AuthenticateEventArgs e)
        {
            LoginFacade f = new LoginFacade();
            bool IsValid = f.Login(UserName, Password);

            if (IsValid)
                e.Authenticated = true;
            else
                e.Authenticated = false;

       }

     

     

    I also have the following questions:

    1. If I use SOA, I will have two websites(the web client and the WCF service host), should I write the code in this way?

     

        protected void LoginControl1_Authenticate(object sender, AuthenticateEventArgs e)
        {

    //----Authenticate against WCF service -------------

              LoginServiceClient proxy = new LoginServiceClient();

    proxy.ClientCredentials.UserName.UserName = UserName;
    proxy.ClientCredentials.UserName.Password = Password;

    //----Authenticate against ASP.NET membership----

            bool IsValid = proxy.Login(UserName, Password);

            if (IsValid)
                e.Authenticated = true;
            else
                e.Authenticated = false;

       }

     

    2. ASP.NET store user identity in session/cookie, how about WCF service?  Can I make use of the the ASP.NET membership credential for the WCF authentication?

    3. If the answer to question 2 is NO, how can I store username/password to avoid writing authenticate code against WCF service?

     

    Thanks a lot!

    Friday, September 28, 2007 8:44 AM

All replies