What is the Order= parameter in the Authorize attribute?

Asked

Viewed 51 times

1

What is the parameter Order in the Attribute AuthorizeAttribute of Authorization of Asp.NET?

How to use it ?

1 answer

2

According to the MSDN page, it indicates the order in which the attribute will be executed, among the filters which are configured in the pipeline of the MVC (IMvcFilter). If the only filter you have is the [Authorize], then the value of the attribute does not matter. If you have more than one, then it can define the order that the authorization logic will be executed.

For example, if you have a filter that logs all requests to your controller. If the order of the authorization attribute causes it to be executed before the logger, then rejected requests will not be logged; otherwise they will be logged.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.