08 ASP - Net Session11
08 ASP - Net Session11
08 ASP - Net Session11
NET
Objectives
Windows Authentication:
Application can be configured to use Microsoft Windows
authentication.
IIS identifies the user by comparing the credentials entered by
the user against the user’s Windows account.
Three possible login methods are provided:
Basic authentication
Digest authentication
Windows Integrated authentication
Forms Authentication:
Authentication is done on the basis of credentials entered by
the user in the login page.
Credentials can be stored in a Database (recommended) or in
a Web.Config file (if number of users are less).
By default, cookies are used to track the session of a user for
subsequent requests.
Query string can also be used in case cookie support is
disabled in the client browser.
The following example shows how to configure Forms
Authentication in the Web.config file :
<authentication mode="Forms">
<forms name=“FormName" loginUrl=“/LogonPage.aspx" />
</authentication>
Passport Authentication:
This is a centralized authentication service provided by
Microsoft.
Microsoft .NET Passport can be used to access services such
as Microsoft Hotmail and MSN Messenger.
Any site can be registered with the Passport service to use the
same Passport for accessing the site.
To use Passport authentication, following steps must be
completed:
1. Obtain the .NET Passport software development kit (SDK).
2. Configure Passport authentication by adding the following
element in the Web.config file :
<authentication mode="Passport">
3. Implement authentication and authorization by using the
functionality in the .NET Passport SDK.
File Authorization:
This is an authorization system provided by Windows.
Permissions can be set on any file or folder stored on a disk
formatted with the NTFS file system.
These permissions are stored in Access Control List (ACL),
which is stored with the file.
The permissions stored in the ACLs can be used to control the
access to the resources, pages, and folders in a Web
application.
To use File authorization:
1. Configure your application to use Windows authentication.
2. Assign permissions to the files and folders in the Web site.
URL Authorization:
Can be used to control access to each virtual directory within a
Web site hierarchy.
Can be used with any of the authentication modules.
To establish permissions for a particular directory:
Create a Web.config file within that directory.
Add an <authorization> section to the file that contains <allow>
and <deny> tags for each user or role.
Two special values that can be used as wildcard identities in
<authorization> section:
“*” : applies to everyone who visits the directory.
“?” : applies to anonymous users.
Problem Statement:
You are a developer in the Adventure Works organization, a
fictitious bicycle manufacturer. You have been asked to assist
in the development of the Business-to-Consumer (B2C) Web
application and a related Business-to-Employee (B2E) extranet
portal.
Decisions on the design of the application have already been
made. You have been asked to carry out a number of specific
tasks in order to implement various elements of this design.
Solution:
You need to perform following tasks:
1. Configuring Authentication and Authorization for a Web Application
a. Open the Adventure Works Web site for editing in Visual Studio.
b. Implement Forms authentication for the Web application.
c. Configure authorization for anonymous users and members.
d. Configure IIS.
e. Implement Windows authentication for the Employees page.
2. Implementing a Membership Registration Page
a. Install the SQL Server provider database.
b. Configure the ASP.NET SQL Server membership provider.
c. Create the membership registration page.
d. Create the membership update page.