. NET Web identity authentication and. NETWeb Identity Authentication

Source: Internet
Author: User

. NET Web identity authentication and. NETWeb Identity Authentication

Baidu click "asp.net Identity Authentication" and you will get a lot of relevant information. These materials will usually introduce content such as "Form authentication" and "Windows Authentication, without a complete process. Beginners often get confused about this, and I have been pitted many times. Therefore, writing this article is a review.

Modern Windows Server systems are based on strict user mechanisms. account and password verification is required when you want to operate the Server. After we deploy the developed Web application on the server, the user accesses the site through the browser, which is actually the process of operating the server through HTTP, essentially, it is also the process of user operations on the server (at least read. This leads to a problem that is ignored by most people: network users do not know the account and password of the server. How can they have the permission to read and write the server? The answer can be shown in the following simple figure:

<Authenticationmode = "Windows"/>

Here, Windows authentication is different from that in IIS. This means that Windows users obtained by IIS are directly uploaded to the website for use. You can add the following code in index. cshtml for access:

Current logon status: @ Request. IsAuthenticated <br/> current logon User: @ User. Identity. Name

If IIS uses any authentication with input boxes other than anonymous authentication, the effect is as follows:

Generally, this method is useless. In most cases, we only use the "anonymous Identity Authentication" Method for IIS. Then, develop your own user logic on your site and set the authentication mode to forms, which is a Form authentication that we are familiar.

The core principle of Form authentication is very simple. A user carries his/her identity certificate (username and password) in the request information. After the site passes verification, the user will be given a ticket to prove his/her identity, the client uses cookies to store the ticket. In future requests, the ticket is attached to the request to prove the identity. There is a great god in the garden who makes it very clear through the series of examples: Sorry! About these two ways, take off brother in his blog explains also very detailed: http://www.cnblogs.com/jesse2013/p/membership.html

Related Article

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.