Configuring Forms Based Authentication (FBA) for SharePoint 2010

Create a new web application from Central Administration.

Select Authentication as Claims Based Authentication

Check Enable FBA checkbox and specify Membership provider name and role manager name as SqlMembers and SqlRoles.

Click on Ok to create the web application.

After successful creation of the web application create a site collection.

Navigate to C:\Windows\Microsoft.NET\Framework64\v2.0.50727 and run aspnew_regsql.exe tool there.

Follow the screen shots below to create a new database named MYFBADB.

After successful creation of the database add the following information(highlighted in yellow) to the web.config file of our FBA application

<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
connectionStringName=SqlConn
applicationName=/
name=SqlMembers
type=System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
minRequiredPasswordLength=5
minRequiredNonalphanumericCharacters=0 />

</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
connectionStringName=SqlConn
applicationName=/
name=SqlRoles
type=System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a />

</providers>
</roleManager>
</SharePoint>
<connectionStrings>
<add
name=SqlConn
connectionString=server=crm2011;database=MYFBADB;Trusted_Connection=true />
</connectionStrings>
<system.web>

Next open the web.config of the Central admin site and add the same information added above

<roleManager
enabled=true
defaultProvider=AspNetWindowsTokenRoleProvider>
         <providers>
             <add
connectionStringName=SqlConn
                 applicationName=/
                 name=SqlRoles
                 type=System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a/>
         </providers>
     </roleManager>

         <providers>
             <add
connectionStringName=SqlConn
                 applicationName=/
                 name=SqlMembers
                 type=System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a />
         </providers>     </membership>

</SharePoint>
    <connectionStrings>
        <add
name=SqlConn
connectionString=server=crm2011;database= MYFBADB;Trusted_Connection=true />

    </connectionStrings>    
<system.web>

Lastly add the following configuration information in the web.config file of the SecurityTokenServiceApplication (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\WebServices\SecurityToken)

    </system.net>
    <connectionStrings>
        <add
name=SqlConn
connectionString=server=crm2011;database= MYFBADB;Trusted_Connection=true />
    </connectionStrings>    <system.web>
        <membership
defaultProvider=SqlMembers>
            <providers>
                <add
connectionStringName=SqlConn
applicationName=/
name=SqlMembers
type=System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a />
            </providers>
        </membership>
        <roleManager
enabled=true
defaultProvider=SqlRoles>
            <providers>
                <add
connectionStringName=SqlConn
applicationName=/
name=SqlRoles
type=System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a/>
            </providers>
        </roleManager>
    </system.web>

That’s it.


Author: Nishant Rana

I love working in and sharing everything about Microsoft.NET technology !

Share your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s