SlideShare a Scribd company logo
Developing Web Applications Using ASP.NET
In this session, you will learn to:
Describe the authentication methods for Web applications
Describe the authorization methods for Web applications
Describe the main components of a membership system
Describe how to build a security administration interface
Configure authentication and authorization for a Web
application
Implement a membership registration page
Implement a login page
Create a membership management administrative user
interface
Objectives
Developing Web Applications Using ASP.NET
Authentication is the process by which users prove their
identity.
This usually involves entering a user name and a password.
ASP.NET 2.0 provides three authentication mechanisms:
Windows authentication
Forms authentication
Passport authentication
Authentication for Web Applications
Developing Web Applications Using ASP.NET
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
Authentication for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
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>
Authentication for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
User accounts are typically stored in a database.
It is possible to keep a list of users in the Web.config file:
<authentication mode="Forms">
<forms name=“LogonPage" loginUrl=“/LogonPage.aspx">
<credentials passwordFormat="SHA1">
<user name="Kim“ password=
"07B7F3EE06F278DB966BE960E7CBBD103DF30CA6"/>
<user name="John“ password=
"BA56E5E0366D003E98EA1C7F04ABF8FCB3753889"/>
</credentials>
</forms>
</authentication>
Authentication for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
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.
Authentication for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
Authorization is the process of determining the pages and
resources that the user has access to after authentication.
Authorization can be implemented using any of the following
methods:
File authorization
URL authorization
Authorization for Web Applications
Developing Web Applications Using ASP.NET
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.
Authorization for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
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.
Authorization for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
The following examples shows how to configure URL
Authorization in an ASP.NET application:
For a directory:
<authorization>
<allow users="Kim"/>
<allow roles="Admins"/>
<deny users="John"/>
<deny users="?"/>
</authorization>
For a Single file:
<location path=“SecuredFile.aspx”><system.web>
<authorization>
<allow users="Joe"/>
<deny users="*"/>
</authorization>
</system.web></location>
Authentication for Web Applications (Contd.)
Developing Web Applications Using ASP.NET
Microsoft ASP.NET membership gives a built-in way to
validate and store user credentials.
It can be used with ASP.NET Forms authentication or with
the ASP.NET login controls to create a complete system for
authenticating users.
It supports facilities for:
Creating new users and passwords
Storing membership information in a data store
Authenticating users
Managing passwords
Exposing a unique identification for authenticated users
Specifying a custom membership provider
Introduction to Membership
Developing Web Applications Using ASP.NET
ASP.NET 2.0 includes a set of classes that enable you to
implement a membership system.
You can use the Membership class to configure a
membership system.
The Membership class provides a range of methods for
managing the members of a Web site:
CreateUser
DeleteUser
UpdateUser
ValidateUser
FindUserByEmail
FindUserByName
Introduction to Membership (Contd.)
Developing Web Applications Using ASP.NET
To use membership, the site must be configured to use it by
performing the following steps:
1. Specify membership options as part of your website
configuration.
2. Configure the application to use Forms authentication.
3. Define user accounts for membership.
After configuring membership for your site, you must create
a login form.
Login form can be created by hand using TextBox controls
or by using Login controls.
How Membership Works
Developing Web Applications Using ASP.NET
Login controls are a set of Web server controls that provide
the common user interface elements of a membership
system.
Login controls automatically use the membership system to
validate a user.
The following controls are available in the Login group of the
Toolbox:
CreateUserWizard
Login
LoginStatus
LoginView
PasswordRecovery
ChangePassword
How Membership Works (Contd.)
Developing Web Applications Using ASP.NET
In case login form is created by hand:
You need to prompt the user for a user name and password
and then call the ValidateUser method to perform the
validation.
You can call methods of the FormsAuthentication class
after authentication to create a cookie and write it to the user’s
computer.
After authentication is done, an object is created that
contains information about the current user.
This object can be used to retrieve information about the
user, such as user’s name, email address, date, and time of
last logon.
How Membership Works (Contd.)
Developing Web Applications Using ASP.NET
The membership system allows your application to accept
and work with anonymous users.
Before using anonymous identification, it needs to be
enabled.
A temporary ID is assigned to unauthenticated users to track
their sessions.
The ID is stored in a cookie or embedded in the URL of
requested pages.
If an anonymous user logs in, the anonymous identification
information is discarded and the user is treated thereafter as
an authenticated user.
Anonymous Users in the Membership System
Developing Web Applications Using ASP.NET
Membership system can be configured in the application’s
Web.config file.
The easiest way to configure and manage memberships is
with the Web Site Administration tool.
Specifications of membership configuration include:
Membership provider to use
Password options
Users and passwords
Membership Configuration and Management
Developing Web Applications Using ASP.NET
Membership can be integrated with ASP.NET role
management to provide authorization services for your site.
Roles can be used to manage the permissions for large
numbers of users.
By grouping users into roles, permissions can be assigned
once for many users.
Roles and Authorization:
In URL authorization mode, access to a directory can be
configured by using the Web.config file in each directory.
Roles can be added to the <authorization> section as:
<authorization>
<allow roles="Admin"/>
<allow roles="PowerUsers" />
<deny users="?"/>
</authorization>
Web Site Security Administration Using the Roles Class
Developing Web Applications Using ASP.NET
Role Management Configuration:
Role management must be configured in the Web.config file in
the root folder of the Web application.
To enable role management, the following item can be included
in the Web.Config file:
<roleManager
enabled="true"
cacheRolesInCookie="true">
</roleManager>
Web Site Security Administration Using the Roles Class (Contd.)
Developing Web Applications Using ASP.NET
You can create and populate roles by:
Using the ASP.NET Web Site Administration Tool
Writing code by using the Roles class
Example of creating and populating roles by using the
Roles class:
Roles.CreateRole("Subscribers");
Roles.AddUsersToRole("Anatoly Sabantsev",
"Subscribers");
Roles.AddUsersToRole("Bobby Moore",
"Subscribers");
You can use the User object to check whether the current
user is a member of a particular role:
if (! User.IsInRole("Subscribers"))
btnDownloadFile.Visible = false;
Web Site Security Administration Using the Roles Class (Contd.)
Developing Web Applications Using ASP.NET
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.
Demo: Controlling Access to a Web Application
Developing Web Applications Using ASP.NET
As part of the first phase of the B2C development, you have
been asked to complete the prototypes for the following pages:
• MembersLogin.aspx. This page collects and checks credentials to
identify the user.
• Register.aspx. This page enables users to become members of
the site.
• Employees.aspx. This page shows sales figures for the
Adventure Works staff, and it should be viewable only by
employees.
• MemberUpdate.aspx. This page enables users to change the e-
mail address and password stored for their account.
• Admin.aspx. This page enables site administrators to change the
role membership on the site.
You will also ensure that several pages are secured properly.
Demo: Controlling Access to a Web Application (Contd.)
Developing Web Applications Using ASP.NET
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.
Demo: Controlling Access to a Web Application (Contd.)
Developing Web Applications Using ASP.NET
3. Implementing a Login Page and Adding Login Controls
a. Create the login page and add the Login control.
b. Add a PasswordRecovery Web server control to the login page.
c. Add login controls to other pages.
d. Test the login and membership features.
4. Creating a Membership Management Administrative User
Interface
a. Configure the Web application to use the SQL Roles provider.
b. Complete the Admin.aspx page.
c. Secure the Administration page.
Demo: Controlling Access to a Web Application (Contd.)
Developing Web Applications Using ASP.NET
Summary
In this session, you learned that:
Authentication is the process by which users prove their
identity.
In Microsoft Windows authentication, IIS identifies the user by
comparing the credentials entered by the user against the
user’s Windows account.
In Form authentication, credentials entered by the user in the
login page are checked with credentials stored in the database
or Web.config file for authentication.
Passport authentication is a centralized authentication service
provided by Microsoft.
Authorization is a process in which after authentication, the
application determines the pages and resources that the user
can access.
Developing Web Applications Using ASP.NET
Summary (Contd.)
In File Authorization, access permissions can be set on any file
or folder stored on a disk formatted with the NTFS file system.
In URL authorization, access to each virtual directory can be
controlled within the website hierarchy.
The Membership class provides methods for creating, deleting,
and updating user accounts, authenticating users, and
managing passwords.
Roles can be created to reduce the administrative overhead of
managing permissions for large numbers of users.
Ad

More Related Content

What's hot (13)

Two factor authentication using login flows
Two factor authentication using login flows Two factor authentication using login flows
Two factor authentication using login flows
CEPTES Software Inc
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.netDifference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
2310 b 16
2310 b 162310 b 16
2310 b 16
Krazy Koder
 
Mobile application
Mobile applicationMobile application
Mobile application
aspnet123
 
Synapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developerSynapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developer
saritasingh19866
 
MOSS2007 Security
MOSS2007 SecurityMOSS2007 Security
MOSS2007 Security
dropkic
 
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Tũi Wichets
 
Bulletin Boards - Quick Start Guide To User Management
Bulletin Boards - Quick Start Guide To User ManagementBulletin Boards - Quick Start Guide To User Management
Bulletin Boards - Quick Start Guide To User Management
VisionsLive
 
Lecture 20101124
Lecture 20101124Lecture 20101124
Lecture 20101124
Anderson Liang
 
RESTful Day 5
RESTful Day 5RESTful Day 5
RESTful Day 5
Akhil Mittal
 
Claims Based Identity In Share Point 2010
Claims  Based  Identity In  Share Point 2010Claims  Based  Identity In  Share Point 2010
Claims Based Identity In Share Point 2010
Steve Sofian
 
How to Build an Indivo X Personal Health App
How to Build an Indivo X Personal Health AppHow to Build an Indivo X Personal Health App
How to Build an Indivo X Personal Health App
Ben Adida
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
Santhosh Sap
 
Two factor authentication using login flows
Two factor authentication using login flows Two factor authentication using login flows
Two factor authentication using login flows
CEPTES Software Inc
 
Difference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.netDifference between authentication and authorization in asp.net
Difference between authentication and authorization in asp.net
Umar Ali
 
Mobile application
Mobile applicationMobile application
Mobile application
aspnet123
 
Synapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developerSynapse india reviews on security for the share point developer
Synapse india reviews on security for the share point developer
saritasingh19866
 
MOSS2007 Security
MOSS2007 SecurityMOSS2007 Security
MOSS2007 Security
dropkic
 
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Windows Server 2008 Active Directory ADFS Claims-base Idm for Windows Part 2
Tũi Wichets
 
Bulletin Boards - Quick Start Guide To User Management
Bulletin Boards - Quick Start Guide To User ManagementBulletin Boards - Quick Start Guide To User Management
Bulletin Boards - Quick Start Guide To User Management
VisionsLive
 
Claims Based Identity In Share Point 2010
Claims  Based  Identity In  Share Point 2010Claims  Based  Identity In  Share Point 2010
Claims Based Identity In Share Point 2010
Steve Sofian
 
How to Build an Indivo X Personal Health App
How to Build an Indivo X Personal Health AppHow to Build an Indivo X Personal Health App
How to Build an Indivo X Personal Health App
Ben Adida
 
MICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAININGMICROSOFT ASP.NET ONLINE TRAINING
MICROSOFT ASP.NET ONLINE TRAINING
Santhosh Sap
 

Viewers also liked (15)

Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
elliando dias
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
dasguptahirak
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
 
Backstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity SummitBackstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity Summit
ForgeRock
 
Customer Identity Builds Digital Trust - London Identity Summit
Customer Identity Builds Digital Trust - London Identity SummitCustomer Identity Builds Digital Trust - London Identity Summit
Customer Identity Builds Digital Trust - London Identity Summit
ForgeRock
 
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
ForgeRock
 
Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...
ForgeRock
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
ForgeRock
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
JayaPrakash.m
 
DevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed DeploymentsDevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed Deployments
ForgeRock
 
The Future is Now: What’s New in ForgeRock Identity Gateway
The Future is Now: What’s New in ForgeRock Identity GatewayThe Future is Now: What’s New in ForgeRock Identity Gateway
The Future is Now: What’s New in ForgeRock Identity Gateway
ForgeRock
 
The Future is Now: What’s New in ForgeRock Identity Management
The Future is Now: What’s New in ForgeRock Identity Management The Future is Now: What’s New in ForgeRock Identity Management
The Future is Now: What’s New in ForgeRock Identity Management
ForgeRock
 
Identity Management with the ForgeRock Identity Platform - So What’s New?
Identity Management with the ForgeRock Identity Platform - So What’s New?Identity Management with the ForgeRock Identity Platform - So What’s New?
Identity Management with the ForgeRock Identity Platform - So What’s New?
ForgeRock
 
OpenAM - An Introduction
OpenAM - An IntroductionOpenAM - An Introduction
OpenAM - An Introduction
ForgeRock
 
The Future is Now: What’s New in ForgeRock Directory Services
The Future is Now: What’s New in ForgeRock Directory ServicesThe Future is Now: What’s New in ForgeRock Directory Services
The Future is Now: What’s New in ForgeRock Directory Services
ForgeRock
 
Developing a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere StudioDeveloping a Struts & Tiles application using WebSphere Studio
Developing a Struts & Tiles application using WebSphere Studio
elliando dias
 
Struts(mrsurwar) ppt
Struts(mrsurwar) pptStruts(mrsurwar) ppt
Struts(mrsurwar) ppt
mrsurwar
 
Backstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity SummitBackstage Tour of Identity - London Identity Summit
Backstage Tour of Identity - London Identity Summit
ForgeRock
 
Customer Identity Builds Digital Trust - London Identity Summit
Customer Identity Builds Digital Trust - London Identity SummitCustomer Identity Builds Digital Trust - London Identity Summit
Customer Identity Builds Digital Trust - London Identity Summit
ForgeRock
 
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
Doing Authorisation, Consent, and Delegation Right with UMA - London Identity...
ForgeRock
 
Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...Identity Relationship Management - The Right Approach for a Complex Digital W...
Identity Relationship Management - The Right Approach for a Complex Digital W...
ForgeRock
 
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
Customer Intelligence: Using the ELK Stack to Analyze ForgeRock OpenAM Audit ...
ForgeRock
 
DevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed DeploymentsDevOps Unleashed: Strategies that Speed Deployments
DevOps Unleashed: Strategies that Speed Deployments
ForgeRock
 
The Future is Now: What’s New in ForgeRock Identity Gateway
The Future is Now: What’s New in ForgeRock Identity GatewayThe Future is Now: What’s New in ForgeRock Identity Gateway
The Future is Now: What’s New in ForgeRock Identity Gateway
ForgeRock
 
The Future is Now: What’s New in ForgeRock Identity Management
The Future is Now: What’s New in ForgeRock Identity Management The Future is Now: What’s New in ForgeRock Identity Management
The Future is Now: What’s New in ForgeRock Identity Management
ForgeRock
 
Identity Management with the ForgeRock Identity Platform - So What’s New?
Identity Management with the ForgeRock Identity Platform - So What’s New?Identity Management with the ForgeRock Identity Platform - So What’s New?
Identity Management with the ForgeRock Identity Platform - So What’s New?
ForgeRock
 
OpenAM - An Introduction
OpenAM - An IntroductionOpenAM - An Introduction
OpenAM - An Introduction
ForgeRock
 
The Future is Now: What’s New in ForgeRock Directory Services
The Future is Now: What’s New in ForgeRock Directory ServicesThe Future is Now: What’s New in ForgeRock Directory Services
The Future is Now: What’s New in ForgeRock Directory Services
ForgeRock
 
Ad

Similar to 08 asp.net session11 (20)

08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
Mani Chaubey
 
Profile
ProfileProfile
Profile
aspnet123
 
Security asp.net application
Security asp.net applicationSecurity asp.net application
Security asp.net application
ZAIYAUL HAQUE
 
ASP.NET 13 - Security
ASP.NET 13 - SecurityASP.NET 13 - Security
ASP.NET 13 - Security
Randy Connolly
 
Documentation
DocumentationDocumentation
Documentation
Kalyan A
 
2310 b 16
2310 b 162310 b 16
2310 b 16
Krazy Koder
 
05 asp.net session07
05 asp.net session0705 asp.net session07
05 asp.net session07
Vivek Singh Chandel
 
pptindustrial (1).pptx
pptindustrial (1).pptxpptindustrial (1).pptx
pptindustrial (1).pptx
quotedcaprio
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
hosleadamsfy
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
Sunil kumar Mohanty
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
mahadekurg
 
SharePoint 2007 Security
SharePoint 2007 SecuritySharePoint 2007 Security
SharePoint 2007 Security
SharePoint & .NET Blog
 
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
tansichaniu6
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
rawenkatesa4
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
bejdajzaher
 
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
kopinegglibh
 
( 16 ) Office 2007 Create An Extranet Site With Forms Authentication
( 16 ) Office 2007   Create An Extranet Site With Forms Authentication( 16 ) Office 2007   Create An Extranet Site With Forms Authentication
( 16 ) Office 2007 Create An Extranet Site With Forms Authentication
LiquidHub
 
Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish Kalamati
Girish Kalamati
 
Bh Win 03 Rileybollefer
Bh Win 03 RileybolleferBh Win 03 Rileybollefer
Bh Win 03 Rileybollefer
Timothy Bollefer
 
12 asp.net session17
12 asp.net session1712 asp.net session17
12 asp.net session17
Vivek Singh Chandel
 
08 asp.net session11
08 asp.net session1108 asp.net session11
08 asp.net session11
Mani Chaubey
 
Security asp.net application
Security asp.net applicationSecurity asp.net application
Security asp.net application
ZAIYAUL HAQUE
 
Documentation
DocumentationDocumentation
Documentation
Kalyan A
 
pptindustrial (1).pptx
pptindustrial (1).pptxpptindustrial (1).pptx
pptindustrial (1).pptx
quotedcaprio
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
hosleadamsfy
 
Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...Microsoft identity platform and device authorization flow to use azure servic...
Microsoft identity platform and device authorization flow to use azure servic...
Sunil kumar Mohanty
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
mahadekurg
 
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
Get Distributed and Cloud Computing 1st Edition Hwang Solutions Manual free a...
tansichaniu6
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
rawenkatesa4
 
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions ManualDistributed and Cloud Computing 1st Edition Hwang Solutions Manual
Distributed and Cloud Computing 1st Edition Hwang Solutions Manual
bejdajzaher
 
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
Download full Distributed and Cloud Computing 1st Edition Hwang Solutions Man...
kopinegglibh
 
( 16 ) Office 2007 Create An Extranet Site With Forms Authentication
( 16 ) Office 2007   Create An Extranet Site With Forms Authentication( 16 ) Office 2007   Create An Extranet Site With Forms Authentication
( 16 ) Office 2007 Create An Extranet Site With Forms Authentication
LiquidHub
 
Azure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish KalamatiAzure from scratch part 2 By Girish Kalamati
Azure from scratch part 2 By Girish Kalamati
Girish Kalamati
 
Ad

More from Vivek Singh Chandel (20)

Deceptive Marketing.pdf
Deceptive Marketing.pdfDeceptive Marketing.pdf
Deceptive Marketing.pdf
Vivek Singh Chandel
 
brain controled wheel chair.pdf
brain controled wheel chair.pdfbrain controled wheel chair.pdf
brain controled wheel chair.pdf
Vivek Singh Chandel
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 
Net framework session01
Net framework session01Net framework session01
Net framework session01
Vivek Singh Chandel
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
Vivek Singh Chandel
 
Net framework session02
Net framework session02Net framework session02
Net framework session02
Vivek Singh Chandel
 
04 intel v_tune_session_05
04 intel v_tune_session_0504 intel v_tune_session_05
04 intel v_tune_session_05
Vivek Singh Chandel
 
03 intel v_tune_session_04
03 intel v_tune_session_0403 intel v_tune_session_04
03 intel v_tune_session_04
Vivek Singh Chandel
 
02 intel v_tune_session_02
02 intel v_tune_session_0202 intel v_tune_session_02
02 intel v_tune_session_02
Vivek Singh Chandel
 
01 intel v_tune_session_01
01 intel v_tune_session_0101 intel v_tune_session_01
01 intel v_tune_session_01
Vivek Singh Chandel
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
Vivek Singh Chandel
 
07 intel v_tune_session_10
07 intel v_tune_session_1007 intel v_tune_session_10
07 intel v_tune_session_10
Vivek Singh Chandel
 
02 asp.net session02
02 asp.net session0202 asp.net session02
02 asp.net session02
Vivek Singh Chandel
 
01 asp.net session01
01 asp.net session0101 asp.net session01
01 asp.net session01
Vivek Singh Chandel
 
16 asp.net session23
16 asp.net session2316 asp.net session23
16 asp.net session23
Vivek Singh Chandel
 
15 asp.net session22
15 asp.net session2215 asp.net session22
15 asp.net session22
Vivek Singh Chandel
 
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Mechanism of fullerene synthesis in the ARC REACTOR (Vivek Chan 2013)
Vivek Singh Chandel
 
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Manav dharma shashtra tatha shashan paddati   munshiram jigyasuManav dharma shashtra tatha shashan paddati   munshiram jigyasu
Manav dharma shashtra tatha shashan paddati munshiram jigyasu
Vivek Singh Chandel
 
Self driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking driversSelf driving and connected cars fooling sensors and tracking drivers
Self driving and connected cars fooling sensors and tracking drivers
Vivek Singh Chandel
 
EEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using ThoughtsEEG Acquisition Device to Control Wheelchair Using Thoughts
EEG Acquisition Device to Control Wheelchair Using Thoughts
Vivek Singh Chandel
 
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Full Shri Ramcharitmanas in Hindi Complete With Meaning (Ramayana)
Vivek Singh Chandel
 

Recently uploaded (20)

GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.Open Access: Revamping Library Learning Resources.
Open Access: Revamping Library Learning Resources.
Rishi Bankim Chandra Evening College, Naihati, North 24 Parganas, West Bengal, India
 
High Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptxHigh Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptx
Ayush Srivastava
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-26-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-26-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Envenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptxEnvenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptx
rekhapositivity
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
World war-1(Causes & impacts at a glance) PPT by Simanchala Sarab(BABed,sem-4...
larencebapu132
 
New Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptxNew Microsoft PowerPoint Presentation.pptx
New Microsoft PowerPoint Presentation.pptx
milanasargsyan5
 
High Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptxHigh Performance Liquid Chromatography .pptx
High Performance Liquid Chromatography .pptx
Ayush Srivastava
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 AccountingHow to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
How to Customize Your Financial Reports & Tax Reports With Odoo 17 Accounting
Celine George
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Envenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptxEnvenomation---Clinical Toxicology. pptx
Envenomation---Clinical Toxicology. pptx
rekhapositivity
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Social Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy StudentsSocial Problem-Unemployment .pptx notes for Physiotherapy Students
Social Problem-Unemployment .pptx notes for Physiotherapy Students
DrNidhiAgarwal
 

08 asp.net session11

  • 1. Developing Web Applications Using ASP.NET In this session, you will learn to: Describe the authentication methods for Web applications Describe the authorization methods for Web applications Describe the main components of a membership system Describe how to build a security administration interface Configure authentication and authorization for a Web application Implement a membership registration page Implement a login page Create a membership management administrative user interface Objectives
  • 2. Developing Web Applications Using ASP.NET Authentication is the process by which users prove their identity. This usually involves entering a user name and a password. ASP.NET 2.0 provides three authentication mechanisms: Windows authentication Forms authentication Passport authentication Authentication for Web Applications
  • 3. Developing Web Applications Using ASP.NET 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 Authentication for Web Applications (Contd.)
  • 4. Developing Web Applications Using ASP.NET 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> Authentication for Web Applications (Contd.)
  • 5. Developing Web Applications Using ASP.NET User accounts are typically stored in a database. It is possible to keep a list of users in the Web.config file: <authentication mode="Forms"> <forms name=“LogonPage" loginUrl=“/LogonPage.aspx"> <credentials passwordFormat="SHA1"> <user name="Kim“ password= "07B7F3EE06F278DB966BE960E7CBBD103DF30CA6"/> <user name="John“ password= "BA56E5E0366D003E98EA1C7F04ABF8FCB3753889"/> </credentials> </forms> </authentication> Authentication for Web Applications (Contd.)
  • 6. Developing Web Applications Using ASP.NET 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. Authentication for Web Applications (Contd.)
  • 7. Developing Web Applications Using ASP.NET Authorization is the process of determining the pages and resources that the user has access to after authentication. Authorization can be implemented using any of the following methods: File authorization URL authorization Authorization for Web Applications
  • 8. Developing Web Applications Using ASP.NET 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. Authorization for Web Applications (Contd.)
  • 9. Developing Web Applications Using ASP.NET 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. Authorization for Web Applications (Contd.)
  • 10. Developing Web Applications Using ASP.NET The following examples shows how to configure URL Authorization in an ASP.NET application: For a directory: <authorization> <allow users="Kim"/> <allow roles="Admins"/> <deny users="John"/> <deny users="?"/> </authorization> For a Single file: <location path=“SecuredFile.aspx”><system.web> <authorization> <allow users="Joe"/> <deny users="*"/> </authorization> </system.web></location> Authentication for Web Applications (Contd.)
  • 11. Developing Web Applications Using ASP.NET Microsoft ASP.NET membership gives a built-in way to validate and store user credentials. It can be used with ASP.NET Forms authentication or with the ASP.NET login controls to create a complete system for authenticating users. It supports facilities for: Creating new users and passwords Storing membership information in a data store Authenticating users Managing passwords Exposing a unique identification for authenticated users Specifying a custom membership provider Introduction to Membership
  • 12. Developing Web Applications Using ASP.NET ASP.NET 2.0 includes a set of classes that enable you to implement a membership system. You can use the Membership class to configure a membership system. The Membership class provides a range of methods for managing the members of a Web site: CreateUser DeleteUser UpdateUser ValidateUser FindUserByEmail FindUserByName Introduction to Membership (Contd.)
  • 13. Developing Web Applications Using ASP.NET To use membership, the site must be configured to use it by performing the following steps: 1. Specify membership options as part of your website configuration. 2. Configure the application to use Forms authentication. 3. Define user accounts for membership. After configuring membership for your site, you must create a login form. Login form can be created by hand using TextBox controls or by using Login controls. How Membership Works
  • 14. Developing Web Applications Using ASP.NET Login controls are a set of Web server controls that provide the common user interface elements of a membership system. Login controls automatically use the membership system to validate a user. The following controls are available in the Login group of the Toolbox: CreateUserWizard Login LoginStatus LoginView PasswordRecovery ChangePassword How Membership Works (Contd.)
  • 15. Developing Web Applications Using ASP.NET In case login form is created by hand: You need to prompt the user for a user name and password and then call the ValidateUser method to perform the validation. You can call methods of the FormsAuthentication class after authentication to create a cookie and write it to the user’s computer. After authentication is done, an object is created that contains information about the current user. This object can be used to retrieve information about the user, such as user’s name, email address, date, and time of last logon. How Membership Works (Contd.)
  • 16. Developing Web Applications Using ASP.NET The membership system allows your application to accept and work with anonymous users. Before using anonymous identification, it needs to be enabled. A temporary ID is assigned to unauthenticated users to track their sessions. The ID is stored in a cookie or embedded in the URL of requested pages. If an anonymous user logs in, the anonymous identification information is discarded and the user is treated thereafter as an authenticated user. Anonymous Users in the Membership System
  • 17. Developing Web Applications Using ASP.NET Membership system can be configured in the application’s Web.config file. The easiest way to configure and manage memberships is with the Web Site Administration tool. Specifications of membership configuration include: Membership provider to use Password options Users and passwords Membership Configuration and Management
  • 18. Developing Web Applications Using ASP.NET Membership can be integrated with ASP.NET role management to provide authorization services for your site. Roles can be used to manage the permissions for large numbers of users. By grouping users into roles, permissions can be assigned once for many users. Roles and Authorization: In URL authorization mode, access to a directory can be configured by using the Web.config file in each directory. Roles can be added to the <authorization> section as: <authorization> <allow roles="Admin"/> <allow roles="PowerUsers" /> <deny users="?"/> </authorization> Web Site Security Administration Using the Roles Class
  • 19. Developing Web Applications Using ASP.NET Role Management Configuration: Role management must be configured in the Web.config file in the root folder of the Web application. To enable role management, the following item can be included in the Web.Config file: <roleManager enabled="true" cacheRolesInCookie="true"> </roleManager> Web Site Security Administration Using the Roles Class (Contd.)
  • 20. Developing Web Applications Using ASP.NET You can create and populate roles by: Using the ASP.NET Web Site Administration Tool Writing code by using the Roles class Example of creating and populating roles by using the Roles class: Roles.CreateRole("Subscribers"); Roles.AddUsersToRole("Anatoly Sabantsev", "Subscribers"); Roles.AddUsersToRole("Bobby Moore", "Subscribers"); You can use the User object to check whether the current user is a member of a particular role: if (! User.IsInRole("Subscribers")) btnDownloadFile.Visible = false; Web Site Security Administration Using the Roles Class (Contd.)
  • 21. Developing Web Applications Using ASP.NET 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. Demo: Controlling Access to a Web Application
  • 22. Developing Web Applications Using ASP.NET As part of the first phase of the B2C development, you have been asked to complete the prototypes for the following pages: • MembersLogin.aspx. This page collects and checks credentials to identify the user. • Register.aspx. This page enables users to become members of the site. • Employees.aspx. This page shows sales figures for the Adventure Works staff, and it should be viewable only by employees. • MemberUpdate.aspx. This page enables users to change the e- mail address and password stored for their account. • Admin.aspx. This page enables site administrators to change the role membership on the site. You will also ensure that several pages are secured properly. Demo: Controlling Access to a Web Application (Contd.)
  • 23. Developing Web Applications Using ASP.NET 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. Demo: Controlling Access to a Web Application (Contd.)
  • 24. Developing Web Applications Using ASP.NET 3. Implementing a Login Page and Adding Login Controls a. Create the login page and add the Login control. b. Add a PasswordRecovery Web server control to the login page. c. Add login controls to other pages. d. Test the login and membership features. 4. Creating a Membership Management Administrative User Interface a. Configure the Web application to use the SQL Roles provider. b. Complete the Admin.aspx page. c. Secure the Administration page. Demo: Controlling Access to a Web Application (Contd.)
  • 25. Developing Web Applications Using ASP.NET Summary In this session, you learned that: Authentication is the process by which users prove their identity. In Microsoft Windows authentication, IIS identifies the user by comparing the credentials entered by the user against the user’s Windows account. In Form authentication, credentials entered by the user in the login page are checked with credentials stored in the database or Web.config file for authentication. Passport authentication is a centralized authentication service provided by Microsoft. Authorization is a process in which after authentication, the application determines the pages and resources that the user can access.
  • 26. Developing Web Applications Using ASP.NET Summary (Contd.) In File Authorization, access permissions can be set on any file or folder stored on a disk formatted with the NTFS file system. In URL authorization, access to each virtual directory can be controlled within the website hierarchy. The Membership class provides methods for creating, deleting, and updating user accounts, authenticating users, and managing passwords. Roles can be created to reduce the administrative overhead of managing permissions for large numbers of users.