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):
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Server=<server name>Database=<dbname>;uid=<username>;pwd=<password>;" providerName="System.Data.SqlClient"/>
</connectionStrings>
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):
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Server=<server name>Database=<dbname>;uid=<username>;pwd=<password>;" providerName="System.Data.SqlClient"/>
</connectionStrings>
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
Anonymous
July 04, 2007
Do you know of any menu based authentication? Could this be modified to show menus based on the user group or permission?Anonymous
August 03, 2007
I am not sure what do you mean by menu based authentication. Can you explain this in more detail?Anonymous
September 19, 2007
hi, 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 shreecanth@gmail.comAnonymous
September 25, 2007
Here are 2 URLs showing how to manage form based users: http://www.codeplex.com/fba/Wiki/View.aspx?title=Home http://www.chandima.net/Blog/Lists/Posts/Post.aspx?ID=6Anonymous
September 26, 2007
pranab, 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. Thanx, srikanth sapellyAnonymous
September 27, 2007
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.Anonymous
October 09, 2007
http://msdn2.microsoft.com/zh-cn/library/aa830816.aspxhttp://www.wwfcn.net/http://msdn2.microsoft.c...Anonymous
March 20, 2008
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.Anonymous
May 04, 2008
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 advanceAnonymous
July 28, 2009
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?Anonymous
October 28, 2010
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 ? Regards, Venkatesh.