Exforsys

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality

Ads


Home arrow Technical Training arrow ASP.NET 2.0

ASP.NET Security

Author : Exforsys Inc.     Published on: 2nd Sep 2005

ASP.NET Security

In this tutorial you will learn about ASP.NET 2.0 Security, The Security Architecture of ASP.NET 2.0, The security infrastructure and subsystem relationships of the ASP.NET and the sequence of events that occur when a authentication is sought.

Ads

When we talk of ‘security’ we are basically acknowledging that there is a possibility of ‘vulnerability’. The developer and the Administrator need to focus on various threats and mitigation techniques and security concepts including principals, authorities, services, security identifiers, tokens, logon sessions, window stations, access control and so on…

Security of websites is a very critical and complex issue that needs to be handled by the developer and the administrator. It requires an understanding of possible threats and a thorough knowledge of access points and vulnerabilities of the application being developed. It presupposes that the developer and the administrator will build in sufficient safeguards in the application being deployed over the network.

ASP.NET 2.0 comes up membership services that manage a database of user accounts, hashed passwords, a role manager for managing role membership for users, and five new server-side controls that make implementing forms authentication much easier. ASP.NET 2.0 also offers a provider model that gives the developer and the administrator complete control over the implementation of the Membership and Role services and cookie-less forms authentication. The Web-based administration enables simple local and remote administration of user accounts and roles, as well as enhanced control of other non-security related settings.

The Security Architecture of ASP.NET 2.0

The security infrastructure and subsystem relationships of the ASP.NET are illustrated in the following diagram.

Web clients communicate with the Internet Information Services (IIS). The IIS deciphers and authenticates the user request. It examines whether the ‘Allow Anonymous’ property has been set to true authentication processes are bypassed, else they are set in motion. The IIS also searches for the requested resource and if the client is authorized it returns the resource else denies the resource. The IIS also assumes that a set of credentials is mapped to the Operating System account and uses them to authenticate the user. Different kinds of authentication is available in IIS.5.0 and 6.0—the basic, the digest and the Integrated Windows Authentication. However, a detailed study on IIS authentication modes is beyond the purview of this tutorial and, therefore, only receives a mention here.

ASP.NET has its own security features and the application built on ASP.NET can have its own low level security features. When the IIS hands over the request to the ASP.NET application, the latter provides three kinds of authentication-forms authentication, Passport authentication and Windows authentication. The type of authentication required is declared in the configuration file of the application. If windows authentication is used the information about users and groups is stored in the Security Accounts Manager(SAM) database or in the Active Directory services. For Passport authentication, user information is stored in the internal passport database. Forms authentication allows the developer specify where to store the information.

Forms authentication is a system whereby unauthenticated requests are redirected to an HTML form using HTTP client-side redirection. The user provides his credentials and submits a form. If the data is authenticated by the application the system issues a ticket in a cookie that contains the credentials or key for reacquiring the identity. All subsequent requests are issued with the cookie in the request headers and they are authenticated and authorized by an ASP.NET handler using the validation method specified by the developer.

Ads

Passport authentication is a centralized authentication service provider that is made available by Microsoft. It offers a single logon and core profile services for member sites.

Windows Authentication is used in conjunction with Microsoft IIS authentication. This type of authentication is commonly used in Intranet scenarios. It provides a user interface and backend code needed to collect user inputs. The developer can be unaware of the data storage and validation of user roles. The identity of the application user is passed in from the IIS.

However, Passport or Windows authentication are not practical for real life scenarios where websites are extremely vulnerable to attacks of hackers and unauthorized entrants. The forms based authentication is considered the best protection for ASP.NET applications and as such has received much focus in ASP.NET 2.0.

On completion of the authentication by IIS, ASP.NET uses the authenticated identity to authorize access.

The sequence of events that occur when a authentication is sought is as under:

................1. A client generates a request for a protected resource on the web.

................2. The request is received by the IIS. The IIS checks whether the resource is authenticated
................by IIS or if Anonymous Access has been enabled for the resource. If yes, the request is
................passed on to ASP.NET application. If the ASP.NET application is set to forms authentication,
................IIS authentication is bypassed.

................3. If the request does not have a cookie attached to it, ASP.NET redirects it to the Logon
................page. The configuration file of the application rests in this path. The client then, enters his
................credentials on the Logon page.

................4. The credentials are checked by the application code using an event handler which checks
................the credentials. If authenticated a ticket is attached(a cookie) containing the username. If
................authentication fails the access denied message is sent to the user and the logon form is
................again presented to the user.

................5. Once the ticket has been issued by the application, ASP.NET checks the ticket for validity
................using a message authentication check.

................6. If the user has been authenticated, ASP.NET proceeds to check for authorization. It either
................provides access to the original resource requested or if the user does not have
................authorization for the resource, the application will redirect the user to another page which
................can be a custom authorization module where the credentials are again tested for
................authorization access. If authorization fails the user is redirected to the logon page.

................7. If the user is authorized, access is granted.



 
This tutorial is part of a ASP.NET 2.0 tutorial series. Read it from the beginning and learn yourself.

ASP.NET 2.0

  1. Getting started with ASP.NET 2.0
  2. .NET Framework Fundamentals
  3. Microsoft.NET Framework Tools
  4. Application Development in .NET
  5. What's New in the .NET Framework 2.0 ?
  6. Introduction to Visual Studio.NET
  7. Installing Visual Studio.NET 2005
  8. Working with Visual Studio.NET Web Applications
  9. Whats New in ASP.NET 2.0
  10. Creating an ASP.NET Application
  11. ASP.NET Code Directory
  12. ASP.NET Page Object Model
  13. ASP.NET Server Controls
  14. ASP.NET Working With Master Pages
  15. ASP.NET Creating Content for Master Page
  16. ASP.NET Referencing Master Page Members
  17. ASP.NET Changing Master Pages Dynamically
  18. ASP.NET Creating Nested Master Pages
  19. ASP.NET Working with Web Parts
  20. ASP.NET Using Web Parts and Controls in Web Pages
  21. ASP.NET Web Pages and Layout
  22. ASP.NET - Adding Web Parts at Run Time
  23. ASP.NET Personalization: User Profiles and Themes
  24. ASP.NET Data Access features
  25. ASP.NET State Management
  26. ASP.NET Customizing the Session State Mechanism
  27. ASP.NET State Management And Caching
  28. ASP.NET Security
  29. Forms Authentication in ASP.NET
  30. ASP.NET Managing Membership and Roles
  31. ASP.NET Configuring Page-Level Caching
  32. ASP.NET Setting Application-Level Caching
  33. ASP.NET Data Source Object Model
  34. ASP.NET SqlDataSource Control
  35. ASP.NET Data Bound Controls
  36. ASP.NET GridView Control
  37. ASP.NET GridView Filtering
  38. ASP.NET Adding Sorting and Paging in GridView
  39. ASP.NET DataBound Controls - Details View
  40. ASP.NET Using a Grid to Display Detail Information
  41. ASP.NET Displaying Master-Detail Data on the Same Page
  42. Displaying Master-Detail Data on Separate Pages in ASP.NET
  43. ASP.NET Creating Web Wizards
  44. ASP.NET : Dynamic Image control
  45. ASP.NET Advanced Site Functionality
 

Comments