Back to Insights

Windows Live Id Integration With SharePoint 2010 Part 2 of 3

Part II - Configuring SharePoint 2010 to use a Custom FBA Provider

The steps below will describe how you can configure a SharePoint 2010 web application to use the custom authentication provider you created in part I of this series.

1. Open SharePoint 2010 Central Administration and click on Manage Web Applications

     SharePoint 2010 Central Administration  - Manage Web Applications

 2. Click the New button to create a new web application

     Create a new web application

3. Fill out the information on the form.

  • Select Claims-Based Authentication
  • Enable Forms Based Authentication(FBA) and specify the name of you custom membership provider and role manager provider
  • Specify  to use the default sign-in page

    Select claims based authentication

Enable FBA Authentication and specify membership and role provider names

 

4.  Navigate to the virtual directories of your new web application and central administration. 

      By default, the virtual directories should be in c:\inetpub\wwwroot\wss\VirtualDirectories\

 Web Application Virtual Directories

 

5.  Open the web.config in the central admin virtual directory and add the following configuration. 

Note: Remember to replace the name of the assembly (name, version, public key).  This information can be found in by browsing to C:\Windows\Assembly, finding your assembly, and selecting properties.  If the assembly is not there yet, add it by deploying your WSP file or manually adding the assembly to the GAC.

   

<system.web>
  <roleManager defaultProvider="AspNetWindowsTokenRoleProvider" enabled="false">
    <providers>
      <add applicationName="/" name="CustomRoleProvider" 
           type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth, 
                 Version=1.0.0.0, Culture=neutral, 
                 PublickKeyToken=e1e8ab661f1bbe8f" />
    </providers>
  </roleManager>
  <membership defaultProvider="CustomMembershipProvider">
    <providers>     
      <add applicationName="/" name="CustomMembershipProvider" 
           type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                 Version=1.0.0.0, Culture=neutral, 
                 PublickKeyToken=e1e8ab661f1bbe8f" />
    </providers> 
  </membership>  
</system.web>

6.  Open the web.config in your new web application's virtual directory and add the following configuration:

<system.web> 
  <membership defaultProvider="i">
    <providers> 
      <add name="i" type"Microsoft.SharePoint.Administration.Claims. 
                         SPClaimsAuthMembershipProvider, 
                         Microsoft.SharePoint, Version=14.0.0.0,                                
                         Culture=neutral, 
                         PublicKeyToken=71e9bce111e9429c" /> 
      <add applicationName="/" name="CustomMembershipProvider" 
           type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                 Version=1.0.0.0, Culture=neutral, 
                 PublickKeyToken=e1e8ab661f1bbe8f" />
    </providers> 
  </membership>
  <roleManager defaultProvider="c" enabled="true" cacheRolesInCookie="false"> 
    <providers> 
      <add name="c" type="Microsoft.SharePoint.Administration.Claims.
                          SPClaimsAuthRoleProvider, Microsoft.SharePoint,
                          Version=14.0.0.0, Culture=neutral, 
                          PublicKeyToken=71e9bce111e9429c" />
      <add applicationName="/" name="CustomRoleProvider" 
           type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth,
                 Version=1.0.0.0, Culture=neutral,  
                 PublickKeyToken=e1e8ab661f1bbe8f" />
    </providers> 
  </roleManager>
</system.web>

7.  Navigate to the SecurityToken service directory(C:\Program Files\Common Files\Microsoft Shared\ Web Server Extensions\14\WebServices\SecurityToken)

8.  Open the web.config  file in the SecurityToken service directory and add the following configuration:

<system.web>
  <membership defaultProvider="CustomMembershipProvider">
    <providers> 
      <add applicationName="/" name="CustomMembershipProvider"
           type="CustomFBAAuth.CustomMembershipProvider, CustomFBAAuth, 
                 Version=1.0.0.0, Culture=neutral, 
                 PublickKeyToken=e1e8ab661f1bbe8f" /> 
      </providers>
    </membership> 
  <roleManager defaultProvider="CustomRoleProvider" enabled="true">
    <providers>
      <add applicationName="/" name="CustomRoleProvider" 
           type="CustomFBAAuth.CustomRoleProvider, CustomFBAAuth, 
                Version=1.0.0.0, Culture=neutral, 
                PublickKeyToken=e1e8ab661f1bbe8f" />
    </providers>
  </roleManager>
</system.web>

9.  Open SharePoint 2010 Central Administration again and create a new site collection using the new web application you created.

      SharePoint 2010 Central Administration - Create site collecitons

 

10.  Configure one of the FBA users as the site collection administration

    Create site collection

11.  Navigate to your new site and you should be prompted with the screen below.  Choose Forms Authentication in the drop down box

Select forms authentication

12.  Enter your credentials and you should be logged-in as one of the form-based authentication users using your custom authentication provider.Enter credentials on form

Share