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

26 lines
1.6 KiB
Markdown
Raw 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 orthogonal and independent from authentication. However, authorization requires an authentication mechanism. Authentication is the process of ascertaining who a user is. Authentication may create one or more identities for the current user.
2016-10-29 01:35:15 +08:00
## 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).