AspNetCore.Docs/aspnetcore/security/authorization/introduction.md

28 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2016-10-29 01:35:15 +08:00
---
title: Introduction to authorization in ASP.NET Core
2016-10-29 01:35:15 +08:00
author: rick-anderson
description: Learn the basics of authorization and how authorization works in ASP.NET Core apps.
2018-01-29 23:21:31 +08:00
ms.author: riande
2016-10-29 01:35:15 +08:00
ms.date: 10/14/2016
uid: security/authorization/introduction
---
# Introduction to authorization in ASP.NET Core
2016-10-29 01:35:15 +08:00
2017-10-14 04:50:30 +08:00
<a name="security-authorization-introduction"></a>
2016-10-29 01:35:15 +08:00
2016-12-04 10:04:32 +08:00
Authorization refers to the process that determines what a user is able to do. For example, an administrative user is allowed to create a document library, add documents, edit documents, and delete them. A non-administrative user working with the library is only authorized to read the documents.
2016-10-29 01:35:15 +08:00
Authorization is separate and distinct from authentication. However, authorization relies on an authentication mechanism. Authentication is the process of verifying a user's identity, which may result in the creation of one or more identity objects for the user.
2016-10-29 01:35:15 +08:00
2020-01-07 04:24:40 +08:00
For more information about authentication in ASP.NET Core, see <xref:security/authentication/index>.
## Authorization types
2016-10-29 01:35:15 +08:00
ASP.NET Core authorization provides a simple, declarative [role](xref:security/authorization/roles) and a rich [policy-based](xref:security/authorization/policies) model. Authorization is expressed in requirements, and handlers evaluate a user's claims against requirements. Imperative checks can be based on simple policies or policies which evaluate both the user identity and properties of the resource that the user is attempting to access.
2016-10-29 01:35:15 +08:00
## Namespaces
Authorization components, including the `AuthorizeAttribute` and `AllowAnonymousAttribute` attributes, are found in the `Microsoft.AspNetCore.Authorization` namespace.
Consult the documentation on [simple authorization](xref:security/authorization/simple).