Download Source Code In this section we will show you how to:
|
Setup Database for SQL Membership Provider
Make sure to grant the account that you will use to run the wcf service to have permission to execute stored procedures in the aspnetdb database.
Setup User Administration Tool
The ASP .net Web Site Administration Tool works by looking at the web.config of the wcf service, where it has the connection string to the database, and renders the information to the administrator:
The tool has to know the location of the wcf application in order to let you manage the users and roles of that application.
First let's setup the Admin Tool. Create an application pool to host the Administration Tool in IIS. We just call it AspNetWebSiteAdmin:
Then create an application in IIS (much like a virtual directory) that points to the location of the Administration Tool, which is at:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles
Click on the Advanced Settings of the newly created application, and set the Physical Path Credentials to the user account that will have access to the path of the Administration Tool (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles):
Be sure to add read and excute permission to the following folder location with the account that runs the Admin Tool:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles
Open the file below using notepad:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\web.config
Change the <authorization> part of the xml to allow anonymous users (for your testing purposes):
Now we need to set up the WCF application that has the web.config that points to the database:
First create the database for the SQL Membership Provider by opening the command prompt and navigate to the location of the .net framework library such as:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Then run the following command:
Aspnet_regsql -S dbServerName -A all -E
replace dbServerName with the name of your database server. Below is what you should see if you create the database on your computer:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Then run the following command:
Aspnet_regsql -S dbServerName -A all -E
replace dbServerName with the name of your database server. Below is what you should see if you create the database on your computer:
Setup User Administration Tool
The ASP .net Web Site Administration Tool works by looking at the web.config of the wcf service, where it has the connection string to the database, and renders the information to the administrator:
The tool has to know the location of the wcf application in order to let you manage the users and roles of that application.
First let's setup the Admin Tool. Create an application pool to host the Administration Tool in IIS. We just call it AspNetWebSiteAdmin:
Then create an application in IIS (much like a virtual directory) that points to the location of the Administration Tool, which is at:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles
Click on the Advanced Settings of the newly created application, and set the Physical Path Credentials to the user account that will have access to the path of the Administration Tool (C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles):
Be sure to add read and excute permission to the following folder location with the account that runs the Admin Tool:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles
Open the file below using notepad:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\ASP.NETWebAdminFiles\web.config
Change the <authorization> part of the xml to allow anonymous users (for your testing purposes):
<authorization>
<allow users="?"/>
</authorization>
Now we need to set up the WCF application that has the web.config that points to the database:
First place the wcf application in a folder, for example the path in our case was:
C:\Prototype\DevLake.BasicAuth\DevLake.BasicAuth.Service
Make sure to grant access to this folder for the account that runs the Admin Tool.
You can now access the Admin Tool by opening a browser with the url that points to the location of the wcf service. In case you are wondering:
http://localhost/AspNetWebSiteAdmin/default.aspx?applicationPhysicalPath=[ApplicationPath]&applicationUrl=[ApplicationUrl]
Make sure to substitute the [ApplicationPath] and the [ApplicationUrl] parameters.
An example of the url would be:
http://localhost/AspNetWebSiteAdmin/default.aspx?applicationPhysicalPath=C:\Prototype\DevLake.BasicAuth\DevLake.BasicAuth.Service&applicationUrl=/DevLake.BasicAuth.Service
Using the tool you can now add users, roles, and assign the users to the roles. Go ahead and add a user and a role using the Admin Tool under the Security tab.
Setup the WCF Basic Authentication Application
The wcf application provided runs under https. Be sure to see how to run wcf under https if you are not familiar with it.
Set up the application in IIS to run under the name DevLake.BasicAuth.Service so that it can be found under the following url:
https://localhost/DevLake.BasicAuth.Service/BasicAuthService.svc
Now you can see the service under https after you have entered the user name and password that you have added using the admin tool:
Next we will show you the WCF Basic Authentication Service.
C:\Prototype\DevLake.BasicAuth\DevLake.BasicAuth.Service
Make sure to grant access to this folder for the account that runs the Admin Tool.
You can now access the Admin Tool by opening a browser with the url that points to the location of the wcf service. In case you are wondering:
- The Tool can be opened only on the same computer that is running the Admin Tool. It will not run if you open the browser from another computer.
- The wcf application does not need to be running for you to use the Admin Tool. The tool just needs to access the web.config of the application.
http://localhost/AspNetWebSiteAdmin/default.aspx?applicationPhysicalPath=[ApplicationPath]&applicationUrl=[ApplicationUrl]
Make sure to substitute the [ApplicationPath] and the [ApplicationUrl] parameters.
An example of the url would be:
http://localhost/AspNetWebSiteAdmin/default.aspx?applicationPhysicalPath=C:\Prototype\DevLake.BasicAuth\DevLake.BasicAuth.Service&applicationUrl=/DevLake.BasicAuth.Service
Using the tool you can now add users, roles, and assign the users to the roles. Go ahead and add a user and a role using the Admin Tool under the Security tab.
Setup the WCF Basic Authentication Application
The wcf application provided runs under https. Be sure to see how to run wcf under https if you are not familiar with it.
Set up the application in IIS to run under the name DevLake.BasicAuth.Service so that it can be found under the following url:
https://localhost/DevLake.BasicAuth.Service/BasicAuthService.svc
Now you can see the service under https after you have entered the user name and password that you have added using the admin tool:
Next we will show you the WCF Basic Authentication Service.
Future series of articles on sharepoint:
- sharepoint list -- the concepts of sharepoint list and how to effectively manage it
sharepoint version control -- the internals of sharepoint version control and how to administer and manage the versions
sharepoint permissions -- how to manage the permissions in a large enterprise sharepoint environment
sharepoint server farm -- how to set up a high availability sharepoint server farm
sharepoint document library -- the details on how to get your ways around the document library in sharepoint
sharepoint configuration -- the configurations needed for different sharepoint network scenarios
sharepoint css -- making the most out of customizing sharepoint frontend
sharepoint web services -- some of the most convienent ways to communicate with the internals of sharepoint