VisualBuilder
  Home > Aspnet > Tutorials > Authorization - ASP.Net Security,Internationalisation and Deployment
Tell a friend
Link to us
Total Members
      Members: 84648
     
Sitemap Forum Chat
Home
ASP.Net Security,Internationalisation And Deployment Tutorial Home
1 . Introduction
2 . Relationship Between IIS and ASP.NET
3 . Authentication in ASP.Net
4 . Form Based Authentication
5 . Form Authentication Flow
6 . Passport Authentication
7 . Windows Authentication
8 . Configuring Windows Authentication
9 . Anonymous Authentication
10 . Basic Authentication
11 . Digest Authentication
12 . Integrated Windows Authentication
13 . Certificate Authentication
14 . Authorization
15 . Authentication Vs Authorization
16 . Impersonation
17 . Code Access security
18 . Internationalization
19 . Deployment
20 . Installing the Application
 
Aspnet Group Home
Aspnet Discussion (10)
Aspnet Members (2379)
Aspnet Resources
Aspnet Source Code (388)
Aspnet Articles (1)
Aspnet Blogs
Aspnet Jobs
Aspnet Components (201)
Aspnet Books
Aspnet Websites (21)
Aspnet News (105)
Aspnet Q & A (114)
- Aspnet Ask Question
- Aspnet Questions
- Aspnet Unanswered Questions
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.NET Development Tips
ASP.Net Security,Internationalisation And Deployment
ASP.NET Server Controls Tips
ASP.NET Tutorial
C Sharp Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Grails Tutorial
Hibernate Tutorial
Java 1.6 Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Service-Oriented Architecture (SOA) Tutorial For Managers
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (436 )
Source Code (3275 )
Articles (11 )
Components (1589 )
News (888 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise


Aspnet security Tutorial
 Authorization
  << Prev: Certificate Authentication Next: Authentication Vs Authorization >>

Authorization is the process of determining if an authenticated user has access to the resource(s) they requested. The authorization modules are called if the request has not been rejected. The authorization modules are also defined in the httpModules element in the machine-level Web.config file as shown here:


 


<httpModules>
<add name="UrlAuthorization"
type="System.Web.Security.UrlAuthorizationModule" />
<add name="FileAuthorization"
type="System.Web.Security.FileAuthorizationModule" />
<add name="AnonymousIdentification"
type="System.Web.Security.AnonymousIdentificationModule" />
</httpModules>


 


There are two types of Authorization:


1. File authorization
2. URL authorization


 


File Authorization:
File authorization is performed by the FileAuthorizationModule, and is active when we use Windows authentication. It does an access control list (ACL) check of the .aspx or .asmxIdentity object in the HttpContext.User.Identity property is an instance of the WindowsIdentity class. If the Identity object is not an instance of the WindowsIdentityFileAuthorizationModule class stops processing.

If an instance of the WindowsIdentity class is present, the FileAuthorizationModule class calls the AccessCheck Win32 function to determine whether the authenticated client is authorized to access the requested file. If the file's security descriptor contains at least a Read Access Control Entry (ACE) in its Discretionary Access Control List (DACL), the request is allowed to proceed. Otherwise, the FileAuthorizationModule class calls the HttpApplication.CompleteRequest method and returns a 401 status code to the client.

URL Authorization:
URL authorization is performed by the URLAuthorizationModule class, which maps users and roles to pieces of the URL namespace. This module implements both positive and negative authorization assertions. That is, the module can be used to selectively allow or deny access to arbitrary parts of the URL namespace for certain sets, users, or roles.
The URLAuthorizationModule is available for use at any time. We only need to place a list of users and/or roles in the <allow> or <deny> elements of the <authorization> section of a configuration file.
handler file to determine if a user should have access. Applications can further use impersonation to get resource checks on resources that they are accessing. It checks whether the class, then the


The general syntax for this section is as follows:

<[element] [users] [roles] [verbs]/>

An element is required. Either the users or the roles attribute must be included. Both can be included, but both are not required. The verbs attribute is optional.
The permissible elements are <allow> and <deny>, which grant and revoke access, respectively. Each element supports three attributes, which are defined in the following:





















Attribute Description
roles Identifies a targeted role for this element. The associated IPrincipal object for the request determines the role membership. You can attach arbitrary IPrincipalWindowsPrincipal class uses Microsoft Windows NT groups to determine role membership objects to the context for a given request and they can determine role membership in whatever way you like. For example, the default
users Identifies the targeted identities for this element.
verbs Defines the HTTP verbs to which the action applies, such as GET, HEAD, and POST.


Anonymous users are also denied.

Example:

<authorization>
<allow users="Visualbuilder"/>
<allow roles="Admins"/>
<deny users="www"/>
<deny users="?"/>
</authorization>


The above example grants access to “Visualbuilder” and members of the Admins role, while denying it to “www” and “all anonymous users”.

In addition to identity names, there are two special identities, as shown in the following:

















Identity Description
* Refers to all identities
? Refers to the anonymous identity

To allow Visualbuilder and deny everyone else, one might construct the following configuration section.

<authorization>
<allow users=" Visualbuilder "/>
<deny users="*"/>
</authorization>


The following example lets everyone do a GET, but only Visualbuilder can use POST.

<authorization>
<allow verb="GET" users="*"/>
<allow verb="POST" users=" Visualbuilder "/>
<deny verb="POST" users="*"/>
</authorization>


  << Prev: Certificate Authentication Next: Authentication Vs Authorization >>
Aspnet Security Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
 
LINKS
web conferencing service
Skype vs. sipcall
Gift to Pakistan
 
ADVERTISEMENT
 
PARTNER LIST

More
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising