How to configure IIS7 for basic authentication in PHP

Source: Internet
Author: User
This article describes how IIS7 implements basic identity authentication in PHP. I hope it will help you. In the PHP runtime environment, configure IIS7 to implement basic authentication methods. In fact, there are several IIS7 authentication methods, such as Windows Authentication and digest authentication, basically, IIS7 basic identity verification is the simplest one. next we will introduce the implementation methods and precautions of IIS7 basic identity verification in text and text, hoping to help PHP beginners.

Preparations

1. because the default IIS7 does not have the configured identity authentication function installed, if you want to implement IIS7 basic identity authentication, you must first install the IIS7 identity authentication function, you need to enable

Control Panel> programs and functions> enable or disable Windows, find IIS, and select basic authentication for installation,

Install IIS7 authentication

2. in addition to installing the IIS7 authentication function, you also need to configure to run PHP5 on IIS7, for more information, see install and configure PHP5 + Mysql in Win7 IIS7.5 + PHP Manager and FastCgi and ISAPI in Windows 7 IIS7.

IIS7 basic authentication Step 1: disable anonymous authentication

Open the IIS Manager, click a directory under the left-side website, and select authentication in the IIS function view on the right. The Anonymous authentication option appears. you must first disable anonymous authentication, this is because the first request sent by all browsers to the server requires anonymous access to the server content. If Anonymous authentication is not disabled, users can access all content on the server anonymously, including restricted content.

IIS7 implements basic authentication step 2: edit basic authentication configuration

After Anonymous authentication is disabled, you can enable the default basic authentication, right-click basic authentication, select edit, and enter the default domain and domain.

IIS7 implements basic authentication step 3: Create a user name and password that have passed identity authentication

You can right-click the computer> Manage> local users and groups to create the corresponding user name and password. I used the PHP Tutorial Network domain name as the user name to create a user

Create a user for IIS7 authentication

Step 4 of IIS7 basic identity authentication: configure the user who passes identity authentication

Open IIS7 manager, find the website directory for authentication, right-click edit permission, click the Security tab, edit Group or user name, and select Add,

Configuration user For IIS7 authentication

After adding a user, you can configure permissions for the user who passes identity authentication based on security requirements.

After completing the above-mentioned IIS7 basic identity authentication configuration, access the previously configured directory in the form of a Web site, there will be a screen asking you to enter the user name and password to continue accessing,

IIS7 authentication access page

IIS7 basic authentication considerations:

1. because the IIS7 basic identity authentication user creden are Base64-encoded, they are not encrypted during network transmission, therefore, basic authentication is considered as an insecure authentication method. Install and configure SSL

2. the default error message for IIS7 basic identity authentication will jump to the HTTP401 page. you can go to the error page in the IIS7 function View to redirect configurations.

Now, the method for implementing basic identity authentication on IIS7 is complete.

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.