Try Now
More in this section

Forums / General Discussions / Invalid provider name "Default" for SitefinityMembershipProvider specified in web.config

Invalid provider name "Default" for SitefinityMembershipProvider specified in web.config

1 posts, 0 answered
  1. zee
    zee avatar
    3 posts
    18 Mar 2012
    01 May 2012
    Link to this post
    **Invalid provider name "Default" for SitefinityMembershipProvider specified in web.config file. The name should match one of the providers configured in Sitefinity's Security.config configuration.**

    I am trying to use sitefinity membership in my asp.net web application to validate users.
    I have a sitefinity database with users and roles. Membership is working in sitefinity project but its not working in external website.

    I copied all the DLL's from bin folder and all files in App_Data/Sitefinity/Configuration to external asp.net web application.

    Also added Provider in web.config

          <membership defaultProvider="Default">
            <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"/>
            <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
                 enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
                 maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
                 applicationName="/" />
    In the SecurityConfig configuration file also added Membership section

         <membership defaultProvider="Default">
        <add name="Default" type="Telerik.Sitefinity.Security.Data.SitefinityMembershipProvider, Telerik.Sitefinity"/>

    In the login button click event i am trying to use

                System.Web.Security.MembershipProvider mp =     System.Web.Security.Membership.Providers["default"];
                var rtn = mp.ValidateUser("admin", "123456");

                if (rtn)
                    Telerik.Sitefinity.Security.UserManager um = Telerik.Sitefinity.Security.UserManager.GetManager();
                    var user = um.GetUser(Model.Username);

     to validate the user but it throws error.

    **Source code Link** :http://www.mediafire.com/?luo87fxigvx4amd
1 posts, 0 answered