Article ID: 306590 - Last Review: October 29, 2007 - Revision: 3.14 INFO: ASP.NET Security Overview
This article was previously published under Q306590 This article refers to the following Microsoft .NET
Framework Class Library namespaces:
On This PageSUMMARY This article provides an introduction to ASP.NET
security. For additional ASP.NET overviews, refer to the following Microsoft Knowledge Base article: 305140
(http://support.microsoft.com/kb/305140/EN-US/
)
INFO: ASP.NET Roadmap
MORE INFORMATION ASP.NET gives you more control to implement security for
your application.
ASP.NET security works in conjunction with Microsoft Internet Information Services
(IIS) security and includes authentication and authorization services to
implement the ASP.NET security model. ASP.NET also includes a role-based
security feature that you can implement for both Microsoft Windows and
non-Windows user accounts. This article is divided into the following sections:
Flow of Security with a RequestThe following steps outline the sequence of events when a client makes a request:
ASP.NET Data Flow For additional information about
impersonating in ASP.NET, click the article number below to view the article in
the Microsoft Knowledge Base: http://msdn.microsoft.com/en-us/library/xa68twcb(vs.71).aspx (http://msdn.microsoft.com/en-us/library/xa68twcb(vs.71).aspx) 306158
(http://support.microsoft.com/kb/306158/EN-US/
)
INFO: Implementing Impersonation in an ASP.NET Application
Related Configuration SettingsIIS maintains security-related configuration settings in the IIS metabase. However, ASP.NET maintains security (and other) configuration settings in Extensible Markup Language (XML) configuration files. Although this generally simplifies the deployment of your application from a security standpoint, the security model that your application adopts necessitates the correct configuration of both the IIS metabase and your ASP.NET application through its configuration file (Web.config).The following configuration sections are related to ASP.NET security:
AuthenticationAuthentication is the process by which you obtain identification credentials such as the user's name and password and validate those credentials against some authority.ASP.NET provides four authentication providers: Forms AuthenticationForms authentication refers to a system in which unauthenticated requests are redirected to a Hypertext Markup Language (HTML) form in which users type their credentials. After the user provides credentials and submits the form, the application authenticates the request, and the system issues an authorization ticket in the form of a cookie. This cookie contains the credentials or a key to reacquire the identity. Subsequent requests from the browser automatically include the cookie.For more information about Forms authentication, refer to the following topic in the .NET Framework SDK documentation:
The Forms Authentication Provider For
additional information Forms authentication in ASP.NET, click the article
number below to view the article in the Microsoft Knowledge Base: http://msdn.microsoft.com/en-us/library/907hb5w9(vs.71).aspx (http://msdn.microsoft.com/en-us/library/907hb5w9(vs.71).aspx) 301240
(http://support.microsoft.com/kb/301240/EN-US/
)
HOW TO: Implement Forms-Based Authentication in Your ASP.NET Application by Using C# .NET
Windows AuthenticationIn Windows authentication, IIS performs the authentication, and the authenticated token is forwarded to the ASP.NET worker process. The advantage of using Windows authentication is that it requires minimal coding. You may want to use Windows authentication to impersonate the Windows user account that IIS authenticates before you hand off the request to ASP.NET.For more information about Windows authentication, refer to the following topic in the .NET Framework SDK documentation:
The WindowsAuthenticationModule Provider http://msdn.microsoft.com/en-us/library/907hb5w9(vs.71).aspx (http://msdn.microsoft.com/en-us/library/907hb5w9(vs.71).aspx) Passport AuthenticationPassport authentication is a centralized authentication service, which Microsoft provides, that offers a single log on and core profile services for member sites. Typically, Passport authentication is used when you need single log on capability across multiple domains.For more information about Passport authentication, refer to the following topic in the .NET Framework SDK documentation:
The Passport Authentication Provider http://msdn.microsoft.com/en-us/library/f8e50t0f(vs.71).aspx (http://msdn.microsoft.com/en-us/library/f8e50t0f(vs.71).aspx) Default AuthenticationDefault authentication is used when you do not want any security on your Web application; anonymous access is required for this security provider. Among all authentication providers, Default authentication provides maximum performance for your application. This authentication provider is also used when you use your own custom security module.AuthorizationAuthorization is the process that verifies if the authenticated user has access to the requested resources.ASP.NET offers the following authorization providers: FileAuthorizationThe FileAuthorizationModule class performs file authorization and is active when you use Windows authentication. FileAuthorizationModule is responsible for performing checks on Windows Access Control Lists (ACLs) to determine whether a user should have access.UrlAuthorizationThe UrlAuthorizationModule class performs Uniform Resource Locator (URL) authorization, which controls authorization based on the URI namespace. URI namespaces can be quite different from the physical folder and file paths that NTFS permissions use.UrlAuthorizationModule implements both positive and negative authorization assertions; that is, you can use the module to selectively allow or deny access to arbitrary parts of the URI namespace for users, roles (such as manager, testers, and administrators), and verbs (such as GET and POST). For more information about authorization in ASP.NET, refer to the following topic in the .NET Framework SDK documentation:
ASP.NET Authorization http://msdn.microsoft.com/en-us/library/wce3kxhd(vs.71).aspx (http://msdn.microsoft.com/en-us/library/wce3kxhd(vs.71).aspx) Role-Based SecurityRole-based security in ASP.NET is similar to the role-based security that Microsoft COM+ and Microsoft Transaction Server (MTS) use, although there are important differences. Role-based security in ASP.NET is not limited to Windows accounts and groups. For example, if Windows authentication and impersonation is enabled, the identity of the user is a Windows identity (User.Identity.Name = "Domain\username"). You can check identities for membership in specific roles and restrict access accordingly. For example:Visual Basic .NET Code Visual Basic .NET Code Visual Basic .NET Code 306238
(http://support.microsoft.com/kb/306238/EN-US/
)
HOW TO: Implement Role-Based Security with Forms-Based Authentication in Your ASP.NET Application by Using Visual Basic .NET
For more information on role-based security, refer
to the following topic in the .NET Framework SDK documentation:
Role-Based Security http://msdn.microsoft.com/en-us/library/52kd59t0(vs.71).aspx (http://msdn.microsoft.com/en-us/library/52kd59t0(vs.71).aspx) REFERENCES For information on ASP.NET security guidelines, see the
following MSDN white paper:
Authentication in ASP.NET: .NET Security Guidance For more general information about ASP.NET, refer to the
following MSDN newsgroup: http://msdn.microsoft.com/en-us/library/ms978378.aspx (http://msdn.microsoft.com/en-us/library/ms978378.aspx) microsoft.public.dotnet.framework.aspnet
(http://msdn.microsoft.com/newsgroups/default.aspx?query=microsoft.public.dotnet.framework.aspnet&dg=&cat=en-us-msdn&lang=en&cr=US&pt=&catlist=774F24A2-F71F-425F-AC2B-DC48AB0DA5C9&dglist=&ptlist=&exp=&sloc=en-us)
For additional information, click the article
numbers below to view the articles in the Microsoft Knowledge Base: 311094
(http://support.microsoft.com/kb/311094/EN-US/
)
BUG: "ConfigurationException" Error Message When Impersonated Accounts Read Configuration
306359
(http://support.microsoft.com/kb/306359/EN-US/
)
PRB: Request.ServerVariables("LOGON_USER") Returns Empty String in ASP.NET
313091
(http://support.microsoft.com/kb/313091/EN-US/
)
HOW TO: Create Keys by Using Visual Basic .NET for Use in Forms Authentication
313116
(http://support.microsoft.com/kb/313116/EN-US/
)
PRB: Forms Authentication Requests Are Not Directed to loginUrl Page
For more information, see the following books:
Reilly, Douglas J. Designing Microsoft ASP.NET Applications
(http://www.microsoft.com/mspress/books/toc/5136.aspx)
. Microsoft Press, 2001. Esposito, Dino.Building Web Solutions with ASP.NET and ADO.NET (http://www.microsoft.com/learning/en/us/Books/5727.aspx) . Microsoft Press, 2001.
| Other Resources Other Support Sites
CommunityGet Help NowArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
