SIGN UP MEMBER LOGIN:    
ARTICLE

Forms based authentication in SharePoint 2010 - Part 1

Posted by Vijai Anand Articles | SharePoint January 20, 2011
In this article we will be seeing how to configure forms based authentication for claims based web application using Active directory provider.
Reader Level:

In this article we will be seeing how to configure forms based authentication for claims based web application using Active directory provider.

Steps Involved:

  • Create a claim based web application
  • Configure the web.config files
    -> Central Administration Web application web.config file
    -> Forms-based authentication claims-based Web application Web.Config file
    -> Security Token Service web.config file

Create a claim based web application:

  • Go to Central Administration =>Application Management => Manage web applications.
  • In the Contribute group click on New.

    1.gif
     
  • In the Authentication section of the Create New Web Application dialog box, click Claims Based Authentication.

    2.gif
     
  • In the Claims Authentication Types section, select Enable Forms Based Authentication (FBA).
  • Type a membership provider name.
  • Click OK to create the Web application.

    3.gif

Configure the web.config files:

  • The Central Administration Web application Web.Config file.
  • The forms-based authentication claims-based Web application Web.Config file.
  • The Security Token Service Web.Config file.

Central Administration Web application web.config file:

  • Go to Start => Run => inetmgr.
  • Go to Sites => SharePoint Central Administration => Right Click => Explore.

    4.gif
     
  • Open the web.config file.
  • Inside the <configuration></configuration> section add the following entry.

    <connectionStrings>
        <
    add name="adconn" connectionString="LDAP://serverName.atest.btest.et/DC=atest,DC=btest,DC=et" />
      </connectionStrings>
    </
    configuration>
     
  • And also add the following entry.

      <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 name="adMembers" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
    " connectionStringName="adconn" enableSearchMethods="true" attributeMapUsername="sAMAccountName" />
          </providers>
        </
    membership>
     
  • Save and close the web.config file.

Forms-based authentication claims-based Web application Web.Config file:

  • Go to Start => Run => inetmgr.
  • Go to Sites => SharePoint - 2014 => Right Click => Explore.
  • Open the web.config file.
  • Inside the <configuration></configuration> section add the following entry.

    <connectionStrings>
        <
    add name="adconn" connectionString="LDAP://serverName.atest.btest.et/DC=atest,DC=btest,DC=et" />
      </connectionStrings>
    </
    configuration>
     
  • And also add the following entry.

      <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 name="adMembers" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="adconn" enableSearchMethods="true" attributeMapUsername="sAMAccountName" />
          </providers>
        </
    membership>

Security Token Service web.config file:

  • Go to Start => Run => inetmgr.
  • Go to Sites => SharePoint Web Services =>Security TokenServiceApplication => Right Click => Explore.
  • Open the web.config file.
  • Inside the <configuration></configuration> section add the following entry.

    <connectionStrings>
        <
    add name="adconn" connectionString="LDAP://serverName.atest.btest.et/DC=atest,DC=btest,DC=et" />
      </connectionStrings>
    </
    configuration>
     
  • And also add the following entry.

    <system.web>
       
    <
    membership defaultProvider="adMembers">
          <providers>
            <
    add name="adMembers"
                 type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a
    "
                 connectionStringName="adconn"
                 enableSearchMethods="true"
                 attributeMapUsername="sAMAccountName" />
          </providers>
        </
    membership>
      </system.web> 

Policy for Forms-based authentication claims-based Web application:

  • Go to Central administration => Application management => Manage service applications.
     
  • Select the web application (SharePoint - 2014).
     
  • In the Policy group, select User policy.

    5.gif
     
  • Click on Next.
  • In the Choose Users section, click on Browse option to search for the users.

    6.gif
     
  • Search for "sptestuser1" user who belongs to "Forms auth" category.

    7.gif
     
  • Select the User =>Add => OK.
  • Select the option "Full control - Has full control" from Choose permissions section.

    8.gif
     
  • Click on Ok.
  • Click on Finish.
  • You could see the user added as shown in the following.

Testing:

  • Create a site collection for the web application SharePoint - 2014.
  • When you try to access the site collection it will be redirected to the login page.
  • Choose forms authentication.

    9.gif
     
  • Enter the user name and password.

    10.gif
     
  • You are now logged into your site as "sptestuser1", with site administrator privileges.

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor