The following article details FBA configuration on a SharePoint 2010 site. If you are looking for information regarding the configuration of FBA on a SharePoint 2007 / WSS 3.0 site, check out this article instead.
Setup your SharePoint 2010 site
- In Central Admin, create a new site. By default, this will use Windows Authentication. Since we haven’t setup FBA yet, we need to setup the Web Application first as a Windows site.
- Create the Web Application
- Create a default Site Collection, and make a windows user (below we’ve used the Administrator account) a Site Administrator.
Setup your User Database
- Setup the ASP.NET Membership Database. Note: You can use custom membership stores, DotNetNuke, even Live! credentials. But the .NET membership database is very simple to setup. This requires the SQL Server database. You can use the integrated version that is supplied with SharePoint, Express or a fully featured SQL Server (Standard or Enterprise) Edition.
- Find the setup file aspnet_regsql.exe located at either of the following locations depending upon your OS:
%windir%\Microsoft.NET\Framework\v2.0.5027
%windir%\Microsoft.NET\Framework64\v2.0.5027 - When the ASP.NET SQL Server Setup Wizard appears, select “Configure SQL Server for application services”, then click Next
- Enter the SQL Server and Database name.
- Above, I have named the database FBADB
- Click Next and Finish
Provide Access to the Membership Database
As an administrator, you’ll be able to add and modify user accounts. But from the SharePoint runtime, we’ll have to provide access to the membership store. This can be done in two ways. If using SSPI (Integrated Security) for the connectionstring from SharePoint, you’ll need to determine the Service Account that runs the Application Pool. Then you’ll provide access to this windows (or service) account in SQL Server to the FBADB database. Or, if you don’t want to use SSPI, or don’t want to take the time to figure out the startup service account for SharePoint you can simply create a login to the FBADB database. Following are steps for the second approach.
- Open SQL Server Management Studio (SSMS 2008) and select Security , then Logins
- Right Click Logins and Select “New Login”
- Create a SQL Server account. Below, we’d created the account FBAService with password pw
- Select “User Mapping”
- Mark the checkbox next to FBADB, and select the row.
- In “Database role membership”, make the user a dbo_owner.
- Click OK to save the new user.
Setup IIS 7.0 Defaults
- Open up Internet Information Services Manager
- Select the Web Server, then double click Connection Strings
- Click Add..
- Enter the Server (.), Database (FBADB) and the Credentials for the user FBAService (by clicking the Set button). If you want to use SSPI, simpy select “Use Windows Integrated Security” instead.
- Click OK to save
- Click to Select the Server from the Connections pane again, and double click Providers.
- On the Feature dropdown, select .NET Users. Your machine may take a while to respond while the configuration is read.
- On the Actions menu, click Add..
- On the Add Provider form, select SqlMembershipProvider as the Type
- Provide a name: FBA.
- Drop down ConnectionStringName and select FBADB
- Set any other parameters you’d like. I set some Password related options for user interaction later.
- Click OK to save
- From the Feature dropdown, select .NET Roles, then click Add..
- Provide a name: FBARole, and select Type: SqlRoleProvider
- Select the ConnectionStringName: FBADB
- Click OK to save the .NET role.
Setup the FBA Zone in SharePoint 2010
- Browse to SharePoint 4.0 Central Administration, Select Security
- In Application Security, select Specify Authentication Providers
- Select the Web Application.
- Click the Default Zone.
- Ensure the Web Application is the correct one on the next page!
- Change Authentication Type to Forms
- Check Enable Anonymous (* note that this does not immediately enable Anonymous access; it merely makes the option available on the front-end web application *
- Click Save.
- When the process is finished, the membership provider should now display FBA.
What SharePoint has done behind the scenes is make the necessary changes to the IIS website to support Forms based authentication. But we still have a little problem. If we browse to the site right now, we won’t be prompted for Windows credentials anymore. Not only do we NOT have a user in the .NET membership database, but we have no FBA based administrators. Let’s tackle that next.
IIS 7.0 Web Site Configuration for SharePoint 2010 FBA
- In IIS Manager, select the SharePoint site. In this example, we used the default site (80).
- Double click the .NET Users icon
- Click Set Default Provider from the actions pane on the left and select FBA
- Click OK to save.
- While we’re here, let’s add our first user. This will be used as an administrative account on the FBA site. Click Add..
- Select a User, Email and Password. Depending upon parameters you defined earlier you may be prompted with challenge/response questions.
** The password may require some strength by default. If you receive an error message that states the “password is invalid”, simply add a number or non-alpha character. - Next, select the SharePoint Central Administation v4 web site from the connections menu in IIS.
- Click .Net Users, then in the Actions menu select “Set Default Provider” and set that to FBA.
Set the User as Site Administrator on the SharePoint 2010 Web Site
- In SharePoint Central Admin v4, go to Application Management
- In the Site Collections section, select “Change Site Collection Administrators”
- On the next page, select the Site Collection we’ve been using.
- You’ll note that the primary site collection administrator has a little red squiggly. Why? We don’t have Windows Authentication enabled for this site and therefore no way to resolve. Delete the Administator account.
- In the field type the user created above (we used fbaadmin), then click the Check Names button. You should see a black underline noting that the name was resolved.
Test the site
- In a Web Browser, when you access the site http://localhost (if that’s what you used), you’ll be presented with the SharePoint login screen, not a Windows login pop-up. (Wow, and you thought SharePoint 2007 had a spartan login screen. Get a load of this !)
- Login with the fbaadmin credentials and you should be able to access the site.
Add the reference to the user friendly people picker
You know the picker…so you can easily find those needles in the haystack. For that to work in Central Admin and this site against your .NET membership database, you need to add a reference to the provider.
- In IIS Manager, browse to the Central Admin web application. Explore the folder and find the web.config file. Open in Notepad.
- Find the
node and use the following:
Comments
Post a Comment