Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Www.asp.Net Mvc Tutorials Authenticating Users With Windows Authentication Cs

Www.asp.Net Mvc Tutorials Authenticating Users With Windows Authentication Cs

Ratings: (0)|Views: 465|Likes:
Published by bc2255

More info:

Published by: bc2255 on Dec 29, 2010
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less





Sign InJoin
Home ASP.NET MVC ASP.NET MVC Tutorials› Authenticating Users with Windows Authentication
(Switch to Visual Basic tutorials)
ASP.NET MVC Overview
Create a Movie Database Application in 15Minutes with ASP.NET MVC ASP.NET MVC OverviewUnderstanding the ASP.NET MVC ExecutionProcessUnderstanding Models, Views, and ControllersCreating a MVC 3 Application with Razor andUnobtrusive JavaScript
 ASP.NETMVC Routing OverviewCreatingCustom RoutesCreating a Route ConstraintCreating a Custom Route Constraint
ASP.NETMVC Controllers
 ASP.NET MVC Controller OverviewCreating a Controller Creating an Action
 ASP.NET MVC Views OverviewCreating Custom HTML HelpersDisplayinga Table of Database Data Using the TagBuilder Class to Build HTMLHelpers
Creating Model Classes with the EntityFrameworkCreating Model Classes with LINQ to SQL
This is the
tutorial (Switch to the Visual Basic tutorial)Learn how to use Windows authentication in the context of an MVC application. You learn how to enable Windowsauthentication within your application’s web configuration file and how to configure authentication with IIS.Finally, you learn how to use the [Authorize] attribute to restrict access to controller actions to particular Windowsusers or groups.« Previous Tutorial |Next Tutorial » The goal of this tutorial is to explain how you can take advantage of the security features built into Internet InformationServices to password protect the views in your MVC applications. You learn how to allow controller actions to beinvoked only by particular Windows users or users who are members of particular Windows groups.Using Windows authentication makes sense when you are building an internal company website (an intranet site) andyou want your users to be able to use their standard Windows user names and passwords when accessing the website.If you are building an outwards facing website (an Internet website) consider using Forms authentication instead.
Enabling Windows Authentication
When you create a new ASP.NET MVC application, Windows authentication is not enabled by default. Forms authentication is the default authentication type enabled for MVC applications. You must enable Windowsauthentication by modifying your MVC application’s web configuration (web.config) file. Find the <authentication>section and modify it to use Windows instead of Forms authentication like this:
When you enable Windows authentication,your web server becomes responsible for authenticating users.Typically, there are two different types of web servers that you use when creating and deploying an ASP.NET MVC application.First, while developing an MVC application, you use the ASP.NET Development Web Server included with Visual Studio.By default, the ASP.NET Development Web Server executes all pages in the context of the current Windows account(whatever account you used to log into Windows).The ASP.NET Development Web Server also supports NTLM authentication. You can enable NTLM authentication byright-clicking the name of your project in the Solution Explorer window and selecting Properties. Next, select the Webtab and check the NTLM checkbox (see Figure 1).
Figure 1 – Enabling NTLM authentication for the ASP.NET Development Web Server 
Authenticating Users with Windows Authentication
C# Tutorials
HomeGet StartedDownloadsWeb FormsMVCAJAXCommunityWikiForums
Performing Simple ValidationValidating with the IDataErrorInfo InterfaceValidating with a Service Layer Validation with the Data Annotation Validators
Master Pages
Creating Page Layouts with View Master PagesPassing Data to View Master Pages
Action Filters and Model Binders
Understanding Action Filters
Improving Performance with Caching
Improving Performance with Output Caching Adding Dynamic Content to a Cached Page
 Authenticating Users with Forms Authentication Authenticating Users with Windows AuthenticationPreventing JavaScript Injection AttacksPreventing Open Redirection Attacks
Creating Unit Tests for ASP.NET MVC Applications
Providing Website Navigation with SiteMaps
Deploying ASP.NET MVC Applications
Using ASP.NET MVC with Different Versions of IIS
Tutorials for Contact Manager 
Iteration #1 – Create the ApplicationIteration #2 – Make the application look niceIteration #3 – Add form validationIteration #4 – Make the application looselycoupledIteration #5 – Create unit testsIteration #6 – Use test-driven developmentIteration #7 – Add Ajax functionality
ASP.NET MVC Music Store
For a production web application, on the hand, you use IIS as your web server. IIS supports several types of authentication including:Basic Authentication – Defined as part of the HTTP 1.0 protocol. Sends user names and passwords in clear text(Base64 encoded) across the Internet.Digest Authentication – Sends a hash of a password, instead of the password itself, across the internet.Integrated Windows (NTLM) Authentication – The best type of authentication to use in intranet environments usingwindows.Certificate Authentication – Enables authentication using a client-side certificate. The certificate maps to aWindows user account.For a more detailed overview of these different types of authentication, seehttp://msdn.microsoft.com/en-us/library/aa292114(VS.71).aspx.You can use Internet Information Services Manager to enable a particular type of authentication. Be aware that all typesof authentication are not available in the case of every operating system. Furthermore, if you are using IIS 7.0 withWindows Vista, you will need to enable the different types of Windows authentication before they appear in the InternetInformation Services Manager. Open
Control Panel, Programs, Programs and Features, Turn Windows featureson or off 
, and expand the Internet Information Services node (see Figure 2).
Part 1: Overview and File->New ProjectPart 2: ControllersPart 3: Views and ViewModelsPart 4: Models and Data AccessPart 5: Edit Forms and TemplatingPart 6: Using Data Annotations for ModelValidationPart 7: Membership and AuthorizationPart 8: Shopping Cart with Ajax UpdatesPart 9: Registration and CheckoutPart 10: Final Updates to Navigation and SiteDesign, Conclusion
NerdDinner Tutorials
Introducing the NerdDinner TutorialCreate a New ASP.NET MVC ProjectCreate a DatabaseBuild a Model with Business Rule ValidationsUse Controllers and Views to Implement aListing/Details UIProvide CRUD (Create, Read, Update, Delete)Data Form Entry SupportUse ViewData and Implement ViewModelClassesRe-use UI Using Master Pages and PartialsImplement Efficient Data Pagingr liin in hniin n
Figure 2 – Enabling Windows IIS features
Using Internet Information Services, you can enable or disable different types of authentication. For example, Figure 3illustrates disabling anonymous authentication and enabling Integrated Windows (NTLM) authentication when using IIS7.0.
Figure 3 – Enabling Integrated Windows Authentication

Activity (2)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->