Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use ASP.NET URL authorization

Shulou Source: shulou.com Published: 2022-06-02 09:16:46 09月19日 Update

This article is to share with you about how to use ASP.NET URL authorization. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

ASP.NET authorization

Authorization can be used to determine whether an authenticated user has accessed a particular resource. This authorization process allows us to restrict users' access-by granting or revoking specific permissions that a user can have. ASP.NET provides two authorization methods: file authorization and URL authorization.

(1) ASP.NET file authorization. This method takes effect automatically when we use windows authentication, which is based on IIS authentication. When a user tries to access a protected resource of an ASP.NET application, IIS first validates it, and then ASP.NET checks the NTFS file permissions or ACL to determine whether the user has access to the resource.

(2) ASP.NET URL authorization. When windows authentication is not used, ASP.NET URL authorization can be used. When a user tries to access a resource, the ASP.NET URL authorization mechanism agrees or denies the requestor's access to the resource according to the role assigned to the application by the ASP.NET authentication process and the identity of the application. Using ASP.NET URL authorization, you can do the following:

◆ Deny or allow access to individual users or groups of users.

◆ Deny or allow access to specific roles.

◆ Restrict access based on the type of HTTP action attempted, such as Get or Post.

Example:

Deny anonymous user access (? On behalf of anonymous users, * on behalf of any user):

Only users with the Domain\ Administrators role can access:

Note that the content in the configuration section is sequentially related to the subitems that ASP.NET looks for until a rule (rule) that matches the current user is found.

No one can access:

Use the Verb property to restrict the action (Action) of HTTP:

Thank you for reading! This is the end of this article on "how to use ASP.NET URL license". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Users resources permissions content files time authentication authentication representatives methods more articles roles processes attempts restrictions good practical things examples Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Shulou Information Huawei Redmi