Windows SharePoint Services 3.0 (WSS 3.0) and Form Base Authentication |
|
Posted Monday, 10 March 2008 by Michael Khanin and Yevgeniy Tokman I believe that these days it is not necessary to explain what SharePoint is. Everyone at least heard the name. I would like to talk about how to install Windows SharePoint Services 3.0 and how to configure it to work in Form Base Authentication mode. You can ask me why Form Base Authentication Mode? There are several reasons for choosing it. One of them was to provide a Web Hosting with SharePoint enabled service. By using Form Base Authentication mode Webmaster can manage users directly through web interface. In this mode all users stored in MS SQL database, so webmaster does not need to have any permission on server or entire network. So, let’s start from scratch, step by step.
On the next screen make selection according to the following picture:
When setup process completed, make sure to leave checkbox selected on the "Run the SharePoint Products and Technologies Configuration Wizard" and click ‘Close” button.
The “SharePoint Products and Technologies Configuration Wizard” should start immediately. On one of the next screens make selection about “farm” settings. In my case, I selected according to the following picture.
OK, now we have to provide information about our SQL server. You can see what I set on my server:
Make sure to check the next screen:
By clicking on “Advance” button on the next screen you will see some information necessary for setting up "Active Directory Account Creation Mode", but we will speak about this in another article, right now just remember about this. So, we are not going to click on “Advance” button :) we just click on NEXT button and relax for a next few minutes until wizard completed.
On the next screen click on the “Create a new Web application”. Fill out all necessary information. Be careful in “Application Pool” section. Take a look at my application:
Of course, you can use other user account, not Administrator, but when I make a configuration, I prefer not to waste time on security issues and use Administrator account. When I get a working system I’m starting a hardening process and perform a security tasks. When Application created, we need to create a new site collection. This process is straight forward, so I don’t what to provide any additional information about it. After all stuff that we did we can start IE and navigate to the http://localhost. We should gate something like this one:
At this point we can start setting up Form Base Authentication mode. Let’s allow the Anonymous access to our web site. We need to come back to our “SharePoint 3.0 Central Administration” and go to “Application Management” tab. On that tab go to Application Security section and click on “Authentication providers” link. On the next screen select your Web Application, and under “Anonymous Access” section select “Enable anonymous access” check box and then click on SAVE button. Now, when we turned on anonymous access we have to go back to our default SharePoint web site (http://localhost) and from “Site Actions” select “Site Settings”.
On the next screen click on “Advanced permissions” link and from “Settings” select “Anonymous Access”
On the “Change Anonymous Access Settings: WSS 3.0” window select “Entire Web site” and click on OK button. We have enabled an Anonymous Access and we can continue to the most interesting part of this article. On the next step I recommend to install “Microsoft Visual Web Developer 2008 Express Edition” on SharePoint Server, it’s absolutely free and could be downloaded from Microsoft. We will use “Microsoft Visual Web Developer 2008 Express Edition” later on.
Keep in mind, that the user used to run SharePoint application pool (On IIS server) must have permissions db_datareader and db_datawriter on just created aspnetdb database.
On the "Virtual Directory Access Permissions" window allow "Read" and "Run scripts (such as ASP)" permissions. Don’t forget to go to the Properties of this virtual directory and be sure that you use the same application pool as a main SharePoint.
OK, now is time to start a “Microsoft Visual Web Developer 2008 Express Edition”. Now from directory C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG we need to open machine.config file. Inside machine.config find the following string:
Now, we need to start "ASP.net Web Site Administration Tool". From the menu go to Website and select "ASP.NET Configuration":
On the "ASP.net Web Site Administration Tool" window click on the Security link
On the next screen click on the “Select authentication type” link. Be sure that “From the internet” option selected
Now we can press DONE button. If we go to the Security tab and click on the “Create user” link we could create a new user.
All users created trough this interface will be stored inside aspnetdb database.
After switch to FORM we have to provide a Membership provider name. Set it to AspNetSqlMembershipProvider like I did this:
So, now we can go back to our home site and if we did all staff correctly we will be able to login by using Form Base Authentication. Before I finish this article I’d like to show you one more thing. By default "ASP.net Web Site Administration Tool" works ONLY locally. Here is what I did to allow using "ASP.net Web Site Administration Tool" remotely. Inside C:\Inetpub\ I created a directory ASP.NETWebAdminFiles and copy inside all content of %WINDIR%\Microsoft.NET\Framework\v2.0.50727\ASP.NETWebAdminFiles directory. Now, open a file App_Code\WebAdminPage.cs and change line: return WebConfigurationManager.OpenMappedWebConfiguration(fileMap, path); to the: return WebConfigurationManager.OpenMappedWebConfiguration(fileMap, path,"Default Web Site"); In the same file found the following block: if (!application.Context.Request.IsLocal) { SecurityException securityException = new SecurityException((string)HttpContext.GetGlobalResourceObject("GlobalResources", "WebAdmin_ConfigurationIsLocalOnly")); WebAdminPage.SetCurrentException(application.Context, securityException); application.Server.Transfer("~/error.aspx"); } And remark it. Now, create a new website that runs on port 8080 and home directory of this site should be C:\Inetpub\TEMP (without any file inside this directory). Under current website, create a new Virtual Directory (ASPADMIN) with a home directory C:\Inetpub\ASP.NETWebAdminFiles. Be sure that you use the same application pool that we use on our SharePoint website. Also, remember to check that ASP.NET version on the properties of this website and Virtual Directory. It should be 2.0.50727. In this case, I really recommend remove Anonymous access on this website. Now, from remote computer we can use "ASP.net Web Site Administration Tool" by browsing to the following address: http://192.168.32.10:8080/aspadmin/default.aspx?applicationPhysicalPath=C:\Inetpub\UserManagement\&applicationUrl=/UserManagement
Note: Remember to put IP address or FQDN name of your server. At this point, I can say “The End”. It’s time to relax and to drink a good beer :). |