2.27.2014

Difference between ASP.NET MVC 4 and ASP.NET MVC 5


S.No
ASP.NET MVC 4
ASP.NET MVC 5
1
ASP.NET Identity Feature:
Not Available
ASP.NET Identity Feature
Available

What is the purpose of ASP.NET Identity?

The MVC project templates have been updated to use ASP.NET Identity for authentication and identity management.

The Startup.Auth.cs class provides us with some examples of ASP.NET identity which can be used for authentication and identity management. Third party login providers (Facebook, Twitter, Google, etc…) are also fully supported.

Example: At the bottom of the table
2
Authentication Filters:
Not Available
Authentication Filters:
Available

What is the purpose of Authentication Filters?

Authentication filters are a new kind of filter in ASP.NET MVC that run prior to authorization filters in the ASP.NET MVC pipeline and allow you to specify authentication logic per-action, per-controller, or globally for all controllers. Authentication filters process credentials in the request and provide a corresponding principal. Authentication filters can also add authentication challenges in response to unauthorized requests.

In Summary, Authentication filters can be used to authenticate users by custom or third party authentication providers

Example: At the bottom of the table
3
Filter Overrides Feature:
Not Available
Filter Overrides Feature:
Available

Why Filter Overrides Feature?
We can now override which filters apply to a given action method or controller by specifying an override filter. Override filters specify a set of filter types that should not be run for a given scope (action or controller). This allows us to configure filters that apply globally but then exclude certain global filters from applying to specific actions or controllers.

i.e., We can say in MVC 5 it’s now possible to override filters on a method or controller by specifying an override filter.


Example: At the bottom of the table
4
Attribute Routing Feature:
Not Available
Attribute Routing Feature:
Available


What is the significance of Attribute Routing?
It allows us to specify our routes by annotating our controllers and actions. Attribute routing was originally a nugget package (created by Tim McCall) which is now integrated into MVC 5.


Example: At the bottom of the table
5
Bootstrap Feature:
Not Available
Bootstrap Feature:
Available


Why Bootstrap?


The MVC project template has been updated to use Bootstrap to provide a sleek and responsive look and feel that we can easily customize.


Example for ASP.NET Identity Feature:

eXsertus Blog

Example for Authentication Filters:

eXsertus Blog by Kris Thoelen

Example for Filter Overrides Feature:

In this example the StoreController is only accessible to the Admin user. By applying our OverrideAuthorize filter the Store action will also be available to the Customer user.

eXsertus Blog by Kris Thoelen

Example for Attribute Routing Feature:

eXsertus Blog by Kris Thoelen




No comments:

Post a Comment