FBA on Share Point

  • Published on
    08-Apr-2018

  • View
    221

  • Download
    0

Embed Size (px)

Transcript

<ul><li><p>8/7/2019 FBA on Share Point</p><p> 1/19</p><p>Setting up ASP.Net 2.0 Forms Authentication User and Role Data Source</p><p>This section explains creation of database which is used to store user's information such ascredentials and roles which is used for Form Authentication. This section also explains theconfiguration of Membership and Role providers in the web.config file and creation of usersusing ASP.Net configuration wizard. This article shows creating a user and which will beused for testing Form Authentication later.</p><p>Create Database</p><p>To create database, Microsoft has provided a tool/utility called aspnet_regsql.exe thatcreates a database for us. This utility can be found in%windir%\Microsoft.NET\Framework\v2.0.50727 folder. Please see the imagebelow:</p><p>Executing aspnet_regsql.exe file will open ASP.Net SQL Setup wizard that will walk throughcreating the ASP.Net 2.0 database. I have added the database name as SPSFormAuth andconfigured it for windows authentication. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 2/19</p><p>Click on Next button. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 3/19</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 4/19</p><p>It will show the summary screen and click the Next button. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 5/19</p><p>Click Next button. Now the database SPSFormAuth is created successfully. Please see theimage below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 6/19</p><p>Configure Membership and Role Providers</p><p>In the previous section, database is created successfully. Now we need to add a user in todatabase. Using ASP.Net Configuration Wizard, users can be added the database. This canbe achieved by creating web site that will allow us to add the users and roles and alsoensure the database connection strings, membership and role providers are correctlyconfigured before we bring SharePoint in to equation.Below steps explains creating web site and configuring membership and role providers andexecuting ASP.Net Configuration Wizard.</p><p>1) Open Visual Studio 2005 and select File New Web Site. In the New Web Sitedialog, select the ASP.Net Web Site template and enter the location to store the website files. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 7/19</p><p>2) Add a new web.config file to web site project. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 8/19</p><p>3) By default, you will see a node within node.Specify the connection string to the database which has been created in the previoussection. Please use the example given below:</p><p>4) After setting up the connection string, we need to specify the membership and roleproviders in the web.config file. In this article, I am using ASP.Net SQL Membership andRole providers. So specify the provider's information within the tag.Please use the example given below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 9/19</p><p>5) Save web.config file and launch the ASP.Net Configuration Wizard by clickingon Website ASP.Net Configuration. Please see the image below:</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 10/19</p><p>6) Set the authentication type in the above wizard. To do this, click Security link. In</p><p>the Security tab, under Users section, click Select authentication type link.Select From the internet option and press Done button which is available in thebottom right corner. By selecting this option, which means that site will use formauthentication to identify users. Please see the image below</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 11/19</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 12/19</p><p>7) To test the membership and role providers, click on Provider tab. In the Provider tab,click on Select a different provider for each feature (advanced) link. Select right /correct membership and role provider and click Test link to ensure that providers arecommunicating to right database.</p><p>At this point, we configured web.config file with connection string and providersinformation. Also we tested the providers with the database. Next section will explainadding users to database.</p><p>Create a User</p><p>1) To add users, click on Security tab. In Security tab, under Users section, click Createuser link. Here I am adding user as testFBA and password as password which will beused for testing form authentication later. Please see the image below:</p><p>Creating Web Applications</p><p>This section explains creating web application using SharePoint Central Administration. Inthis article I am creating two, sites; one is extranet site which will be used by the contentowners and configured to windows authentication. Another site is internet site specificallyfor internet users and configured to form authentication. Below section explains creating oftwo sites.</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 13/19</p><p>Creating extranet IIS Web site</p><p>1) Click Start All Programs Microsoft Office Server Central Administration.2) In the Application Management tab, under SharePoint Web Application</p><p>Management section, click Create or extend Web application link.</p><p>3) In Create or Extend Web Application page, click Create a new WebApplication link. Provide the information to create new web application and</p><p>click OK button. Please see the image below.</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 14/19</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 15/19</p><p>4) Create site under the above web application. To do this, in ApplicationManagement tab, under SharePoint Site Management section, click Create site</p><p>collection link.5) In Create Site Collection page, select the web application which have been created in the</p><p>previous step and provide other information to create the site and click OK button.Please see the image below.</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 16/19</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 17/19</p><p>Now we created the web application and site successfully. Next section explains creatinginternet site.</p><p>Creating internet IIS Web site</p><p>This section explains extend our web application to another internet site which has beencreated in the previous sections. This site is for anonymous or internet users.</p><p>1) Click Start All Programs Microsoft Office Server Central Administration.2) In the Application Management tab, under SharePoint Web Application</p><p>Management section, click Create or extend Web application link.3) In Create or Extend Web Application page, click Extend an existing Web</p><p>application link. Provide the information to extend the web application andclick OK button. Please see the image below.</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 18/19</p></li><li><p>8/7/2019 FBA on Share Point</p><p> 19/19</p><p>Now we have successfully created extranet and internet site. Below is the URL for thesesites.</p><p>For extranet site: http://moss2007:36024/sites/fba/default.aspxFor internet site: http://moss2007:36025/sites/fba/default.aspx</p><p>Open the browser and test both the site by typing the URL. But these two sites are asking</p><p>about windows authentication because these sites are not yet configured to formauthentication.Below section explains configuration of web.config file of each site with connection stringand providers information.</p><p>Configure Web App to communicate with Form Authentication Data Store</p><p>In this section, we are modifying the web.config file of two sites. Web.config file resides inthe root directory of the site i.e. c:\Inetpub\wwwroot\wss\Virtual Directories. Underthis, two folders i.e. 36024 and 36025 are available. Web.config file of specific site isavailable inside these folders.</p><p>Configure web.config file of extranet site</p><p>The web.config file of extranet site is available inc:\Inetpub\wwwroot\wss\VirtualDirectories\36024folder.</p><p>1) Open web.config file, specify the node defined in thesection 2.2.c just after the closing tag and opening tag.Please see the image below:</p><p>2) Add the membership and role provider node which is defined in the section 2.2.d, justafter opening the tag. Please see the image below</p><p>3) Save the web.config file.Configure web.config file of internet site</p><p>The web.config file of internet site is available inc:\Inetpub\wwwroot\wss\VirtualDirectories\36025folder.</p><p>1) Open the web.config file and follow the same step specified in the Section4.12) Here we need to very careful while specifying defaultProvider information for Role</p><p>Provider. In the Role Manager attribute, add AspNetWindowsTokenRoleProvider asdefaultProvider. This is necessary because Central Administration still uses WindowsAuthentication for the role provider. Please see the image below:</p><p>3) Save the web.config file.</p></li></ul>