How to Implement Form Based authentication in SharePoint 2007 (MOSS/WSS) using AspNetSqlMembershipProvider

There is already a good no. of examples in different blogs showing how to implement FBA in MOSS 2007/WSS 3.0. Here are the steps I followed and found working perfectly for me:

1. Set up a web application and a site collection under it. Do not open the site in Browser yet.

2. Create a new Database in SQL Server

2.  Go to Visual Studio Command Prompt and type aspnet_regsql and use the database created in the step above.

3.  Using Visual Studio 2005 creates a fresh aspx web App with web.config entry before <system.web> as below ( the dbname should be the same as in step 2):


<remove name="LocalSqlServer" />

<add name="LocalSqlServer" connectionString="Server=<server name>Database=<dbname>;uid=<username>;pwd=<password>;" providerName="System.Data.SqlClient"/>


4. Go to ASP.Net configuration at the top of Solution Explorer and add a user “test”.

5. Change the membership provider for the created SharePoint Web Application created on step 1 above from Central admin> Application Management> Authentication Providers. Change the Authentication Type to “Form” and Membership provider name as AspNetSqlMembershipProvider

6. Add entry in the web.config of the SharePoint Web Application and also in the Central Admin Web App’s web.config (same as in step 3):


<remove name="LocalSqlServer" />

<add name="LocalSqlServer" connectionString="Server=<server name>Database=<dbname>;uid=<username>;pwd=<password>;" providerName="System.Data.SqlClient"/>


7. Change the site collection administrator of the SharePoint Web Application to "test"  using Central admin> Application Management>Site Collection Administrators


8. Close central admin Site

9. Open the SharePoint Web Application and you will find the FBA is working.

There is one issue that is associated with Form Based Authentication. You can not find the "MySite" link at the top right corner of the site after you log-in. Here is an article showing how to implement it:

Office SharePoint Server 2007 - Forms Based Authentication (FBA) w/MySites Walk-through - Part 2

Comments (11)
  1. Venkatesh Basi says:

    Hi Pranab,

    I have successfully FBA enabled the sharepoint site but I am unable to add the sharepoint services as service reference for Windows phone app. Can you please let me know whether we could as reference if we enable FBA ?



  2. Chris says:

    Great steps to complete FBA. However, when I have this setup and I access the site. I see Sign in. When I sign in as the Primary collection administrator I do not see the Site Actions Menus. I had to allow ananymous access to the site before even this would occur. Am I missing something in my configuration for FBA?

  3. Raxi says:

    Hi Pranab…

    Can u pls tell me how to add custom code in login form on button click. (For Eg: counting falure attempt and sending mail as an alert)

    Thanks in advance

  4. priyanka says:

    Can i have more than one membership prviders for the same zone? I need it bcoz our ADS hierarchy is of domains and sub domains, plz help.

  5. Pranab-MSFT says:

    At the end of the article itself I already provided a link to a resource where you can find how to resolve the MySite issue.

  6. shreecanth says:


    thanx for your comments, the links that you have provided talks about forms based authentication(FBA), which i know earlier only, but what i want is configuring the "MySite" link on FBA site. I am unable to see the "MySite" link on FBA site.

    help will be appreciated.


    srikanth sapelly

  7. srikanth sapelly says:


       I am unable to see the Mysite link in one of our portal which has forms authentication enabled. How can import all user profiles of Aspnetdb database in our portal. I tried from shared service provider, user profiles and properties but not succeded, can you help me out in this regard, please mail your response to

  8. Pranab-MSFT says:

    I am not sure what do you mean by menu based authentication. Can you explain this in more detail?

  9. Heather says:

    Do you know of any menu based authentication?  

    Could this be modified to show menus based on the user group or permission?

Comments are closed.

Skip to main content