Configure SharePoint Forms Based Authentication to use SQL user accounts

Written By: Matt Takhar -- 8/11/2010 -- join -- contribute -- (3342) comments -- printer friendly version

Rating: Rate --

Categories: Configurations, IIS, Infrastructure, MOSS 2007, System Administration, WSS3

< Prev - 1 | 2 | 3 | 4 | 5 | - Next > | Become a paid author

Create a User

Now that we have a database to store our users in we need to create at least one user. Again the easiest way to do this at this stage is via Microsoft Visual Studio as it has a built in web application which connects to a membership and role provider store.

  1. Create a folder called FBA Management Site, just use your desktop as it temporary
  2. Open Microsoft Visual Studio, screen shots below show the 2005 version.
  3. Select File -> Open -> Web Site.
  4. In the Open Web Site dialog, choose the File System icon on the left side of the dialog, then browse to and select the FBA Management Site folder created in step 1.
  5. Click Open.
  6. In the Solution Explorer, right-click on the web site and select Add New Item.
  7. Select Web Configuration File and click Add. There is no need to rename the file, web.config is fine.
  8. Replace the empty <connectionStrings/> element with the following snippet. Be sure to replace both <server name> and <database name> with their appropriate values.

  9. <connectionStrings>
    <add name="AspNetDbFBADemoConnectionString"
    connectionString="Data Source=<server name>; Initial Catalog=<database name>; Integrated Security=True"/>

  10. Just below the <system.web> element, add the following membership and roleManager elements. Be sure to update the connectionStringName attributes of each of the two providers to the name of the connection string name you created in the step above.

  11. <!-- membership provider -->
    <membership defaultProvider="FBADemoMember">
    type="System.Web.Security.SqlMembershipProvider, System.Web,Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    <!-- role provider -->
    <roleManager enabled="true" defaultProvider="FBADemoRole">
    type="System.Web.Security.SqlRoleProvider, System.Web,Version=,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

  12. Save and close the web.config file.
  13. Click ASP.NET Configuration under Website. The ASP.NET Web Site Administration Tool opens in a browser. If the tool does not appear, or cannot connect, verify the connection string and provider information entered above.
  14. Click on the Security tab. You are presented with the following. From here we will create our users and roles.

  1. Click on the Select authentication type link in the Users box on the left.
  2. Select the From the internet radio button then click the Done button in the bottom right hand corner of the window.
  3. Create an Administrator, Manager and Employee role. This step and the next three are intuitive enough that I am not going to spell them out.
  4. Create a single Administrator user, spadmin. Be sure to assign the user to the Administrator role as you create it.
  5. Close the ASP.NET Web Site Administration Tool.
  6. Close Microsoft Visual Studio 2005.

< Prev - 1 | 2 | 3 | 4 | 5 | - Next >

Learn more about SharePoint

Sponsor Information

Copyright (c) 2010-2017 Edgewood Solutions, LLC All rights reserved
privacy | disclaimer | copyright | advertise | contribute | feedback | about
Some names and products listed are the registered trademarks of their respective owners. |