Welcome to MSDN Blogs Sign in | Join | Help

Pranab Paul's Blog - Development Tips on SharePoint, Office and Web

------------------------------------------Web Parts, Workflow, InfoPath Form Services, Features, Site Definition, Event Receivers, Excel Services, Business Data Catalog (BDC), Search

News

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

Posted: Monday, July 02, 2007 4:04 PM by pranab

Comments

Heather said:

Do you know of any menu based authentication?  

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

# July 4, 2007 10:56 AM

pranab said:

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

# August 3, 2007 11:28 AM

srikanth sapelly said:

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.com

# September 20, 2007 4:26 AM

pranab said:

# September 25, 2007 10:07 AM

srikanth sapelly said:

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 sapelly

# September 27, 2007 6:30 AM

pranab said:

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.

# September 27, 2007 1:24 PM

priyanka said:

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.

# March 21, 2008 1:12 AM

Raxi said:

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

# May 4, 2008 9:42 PM

Chris said:

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?

# July 28, 2009 12:18 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker