Skip to main content

Steps to set Form based authentication (FBA) for SharePoint 2010

1.       DOWNLOAD FBA User Management Tool

          Go to “C:\Windows\Microsoft.NET\Framework\v2.0.50727”.

2.       Open file “aspnet_regsql.exe” (with Run as Administrator).

                                I.            You will get an installation form. Hit “Next” button.


                              II.            Click on “Configure SQL Server for application services” then hit “Next” button.


                            III.            Now provide server name to connect & install new database for Membership. Now hit “Next” button.

                            IV.            Now you get a summary page on which you will get server name & its new database name called “aspnetdb”. Click on “Next” button.


                              V.            Now database has been created. Click on “Finish” button.


3.       Install FBA tool.
4.       Create a new Site collection (suppose we called it “A”).
5.       Extend this site (Suppose we called it “B”).
                                I.            Open Central Administration.
                              II.            Click on Application Management.
                            III.            Click on Manage Web application.


                            IV.            Click on “Site A” & then hit Extend button on ribbon.


1.       Click on Create a new IIS web site.
2.       Provide name & port number (optional).
3.       Provide host header (optional)
4.       Select Anonymous Access to –No
5.       Use Secured Socket layer – No

6.       Check on Enable Windows Authentication. Check On Integrated windows authentication & select “NTLM”.

7.       Check Enable Forms Based Authentication.  In “ASP.NET Membership provider name” put “SqlMember” & in ASP.NET Role manager name put “SqlRole”.

8.       Select – Default Sign in Page.
9.       Select Zone.
10.   Click OK.

11.   After creating this site, Test this site.

6.       Make changes in web.config files.
                                I.            Open inetmgr.
                              II.            Explore Site A & take back up of web.config file.
1.       Open web.config file.
2.       Put this connection string just after  configSections>
<connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=test-share3\sharepoint;Integrated Security=SSPI;Initial Catalog=aspnetdb" providerName="System.Data.SqlClient" />
  connectionStrings>
3.        Search for entry <PeoplePickerWildcards> & put this entry within this tag.
<add key="SqlMember" value="%" />
               <add key="SqlRole" value="%" />
4.       Search for entry <membership> & < roleManager> replace whole entry with :



<membership defaultProvider="i" userIsOnlineTimeWindow="15" hashAlgorithmType="">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordAttemptWindow="10" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" name="SqlMember" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </membership>
    <roleManager enabled="true" cacheRolesInCookie="false" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" defaultProvider="c" createPersistentCookie="false" maxCachedResults="25">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add applicationName="/" name="SqlRole" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </roleManager>

 
5.       Now save & close this web.config file.

                            III.            Explore Site B (Extended new site) & take back up of web.config file.
1.       Open web.config file.
2.       Put this connection string just after  configSections>
<connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=test-share3\sharepoint;Integrated Security=SSPI;Initial Catalog=aspnetdb" providerName="System.Data.SqlClient" />
  connectionStrings>
3.        Search for entry <PeoplePickerWildcards> & put this entry within this tag.
<add key="SqlMember" value="%" />
               <add key="SqlRole" value="%" />
4.       Search for entry <membership> & < roleManager> replace whole entry with :
<membership defaultProvider="i" userIsOnlineTimeWindow="15" hashAlgorithmType="">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordAttemptWindow="10" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" name="SqlMember" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </membership>
    <roleManager enabled="true" cacheRolesInCookie="false" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" defaultProvider="c" createPersistentCookie="false" maxCachedResults="25">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add applicationName="/" name="SqlRole" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </roleManager>
5.       Now save & close this web.config file.
                            IV.            Explore Central Administration Site & take back up of web.config file.
1.       Open web.config file.
2.       Put this connection string just after  configSections>
<connectionStrings>
    <clear />
    <add name="AspNetSqlMembershipProvider" connectionString="data source=test-share3\sharepoint;Integrated Security=SSPI;Initial Catalog=aspnetdb" providerName="System.Data.SqlClient" />
  connectionStrings>
3.        Search for entry <PeoplePickerWildcards> & put this entry within this tag.
<add key="SqlMember" value="%" />
               <add key="SqlRole" value="%" />
4.       Search for entry <membership> & < roleManager> replace whole entry with :
     
   <membership defaultProvider="i" userIsOnlineTimeWindow="15" hashAlgorithmType="">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordAttemptWindow="10" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" name="SqlMember" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="i" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </membership>
    <roleManager enabled="true" cacheRolesInCookie="false" cookieName=".ASPXROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All" defaultProvider="c" createPersistentCookie="false" maxCachedResults="25">
      <providers>
        <clear />
        <add connectionStringName="AspNetSqlMemberShipProvider" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add applicationName="/" name="SqlRole" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, &#xD;&#xA;Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="c" type="Microsoft.SharePoint.Administration.Claims.SPClaimsAuthRoleProvider, &#xD;&#xA;Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      </providers>
    </roleManager>  
     
   
5.       Now save & close this web.config file.

                              V.            Now click on “SharePoint web services” & then click on “SecurityTokenServiceApplication” and explore it.


1.       Search for tag system.net> & paste this just after system.net> tag
<connectionStrings>
            <clear />
            <add name="AspNetSqlMembershipProvider" connectionString="data source=test-share3\sharepoint;Integrated Security=SSPI;Initial Catalog=aspnetdb" providerName="System.Data.SqlClient" />
      connectionStrings>
      <system.web>
            <membership defaultProvider="SqlMember">
                  <providers>
                        <add connectionStringName="AspNetSqlMembershipProvider" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" passwordAttemptWindow="10" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" name="SqlMember" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,      Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                  providers>
            membership>

            <roleManager defaultProvider="SqlRole" enabled="true">
                  <providers>
                        <add connectionStringName="AspNetSqlMembershipProvider" applicationName="/" name="SqlRole" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0,      Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
                  providers>
            roleManager>
      system.web>
2.       Now Save & Close this. Web.config file.

7.       Go to Center Administration, Click on Manage Web Application.
8.       Select Site “A” & Click on User Policy.
                                I.            You will get a dialog box


                              II.            Click on “Add Users”, you will see the below dialog box, which will ask you to select the zone for which you want to add the users. Select zone and click next


                            III.            In the next window, “Choose Users” then “Choose Permission” for those users and click Finish.



Important Note:  Don’t forget to grant “dbOwner” access to NT/AUTHORITY user on aspnetdb database.

-----------------------------------------------------------------------------------
DOWNLOAD FBA User Management Tool
-----------------------------------------------------------------------------------
9 comments

Popular posts from this blog

SharePoint Interview Questions and Answers

SharePoint Interview Questions and Answers

Get More Questions and Answers

QWhat is SharePoint?AnsSharePoint is a browser based document collaboration platform given by Microsoft.

QWhat are features of SharePoint 2010?AnsSome features are :
·Document Collaboration ·Enterprise Search FAST Search ·New Enhance Web Part ·Ready made Silver Light web part ·Business Connectivity Services ·Social Media Investments ·Large lists ·Enhanced collaboration features ·Visio Services ·Usage reporting and logging ·Better Network Differencing & SharePoint Offline in SharePoint Workspace ·High Availability/ Disaster Recovery Innovation ·Admin Insights through the Logging & Usage database, and dev dashboard ·Service Applications ·

How to get current logged user information using JavaScript ?

This is post which is simple and not really needed. But when I started writing the code in ECMAScript I have faced problems in getting the logged in user information. So, my readers may feel good after see this post and really most the users are looking for this too.
By this time, we have really understood all about ECMAScript Client Object Model and debugging. So, it's easy for us to know it well.
Please find the code below to get the current user information.


<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">

Now copy & paste this JavaScript code after above mentioned tag :
<script type="text/ecmascript">

        ExecuteOrDelayUntilScriptLoaded(getUserData, "sp.js"); 


    // To Get Current User Name
    var context = null; 
    var web = null; 
    var currentUser = null; 
    var currentUserId=''
    function getUserData() {

            context = new SP.ClientContext.get_current(…

SharePoint Interview Questions and Answers

How does Client object model works Q. How does Client object model works? Ans. When we use SharePoint client API’s to perform a specific task, the SharePoint Foundation 2010 managed client object model bundles up these uses of the API into XML and sends it to the server that runs SharePoint Foundation. The server receives this request, and makes appropriate calls into the object model on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that JSON back to the SharePoint Foundation 2010 managed client object model. The client object model parses the JSON and presents the results to the application as .NET Framework objects (or ECMAScript objects for ECMAScript).
Q. How many types of Client Object model extension are available in 2010 and when would you use one or the other. Ans. To develop rich client side solutions, three set of client-side APIs has been introduced in the Microsoft.SharePoint.Client namespace. The three APIs are targeted for t…