20.3 IIS 7.0 and form verification (2)

Source: Internet
Author: User

20.3 IIS 7.0 and Form Verification 2)

However, it is not enough to put ASP content together with ASP. NET-based login pages and configure form verification. Form verification does not work when you try to access a traditional ASP page. Depending on the verification and authorization rules, you may get an "unauthorized" response or direct access to the traditional ASP page without a logon reminder. You will learn more about authorization rules and their behaviors in Chapter 23rd ).

The cause of this behavior is that the HTTP module hosted by default, such as the form verification module, is configured to only execute requests for ASP. NET-based code. Therefore, to make form verification work, You must select the HTTP module configuration feature on the IIS 7.0 console after selecting the Web application to modify this line. Then, open the configuration details of the FormsAuthentication module in the module list, as shown in Figures 20-7 and 20-8.

After enabling the HTTP module configuration feature, you need to find the FormsAuthentication item and double-click it, or click the "edit" link in the taskbar on the right of the Management Console. In the displayed Setting dialog box, disable the "Invoke Only for Requests to ASP. NET Applications or Managed Handlers" option, as shown in 20-8.

After this configuration is complete, When you access the traditional ASP page in the Web application directory, the request will use ASP. NET Form Verification for verification. The Web. config content of the web application is roughly as follows:

 
 
Figure 20-7 select the HTTP module configuration feature in the Web Application
 
Figure 20-8 configuration details of the FormsAuthentication Module

The configuration of the FormsAuthentication module is very important. Pre-Condition = "" is displayed in the configuration according to the check mark configured in Figure 20-8, and its default value is managedHandler.

On the whole, you can use this method to maximize ASP. NET application capabilities for Web applications configured based on IIS 7.0 Web servers, such as form verification or membership APIs described in Chapter 21st. Compared with the previous version of IIS, this is a huge advantage, and it makes many things easier.

BibliographyPrevious sectionNext section

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.