Header Ads Widget

Responsive Advertisement

Introduction to ASP.NET Identity


Definition:  ASP.NET Identity is a secured way of authentication methods in web applications. It is used for identifying the authorized user.  ASP.NET Identity is used to find and allow the users to enter the application based on their authentication and authority. It does not allow anonymous users to enter the application.  ASP.NET Identity is a complete package, which is available on nugget package manager. Identity internally uses Entity Framework code first approach.  It includes profile support, OAuth integration, works with OWIN.
ASP.NET Identity is come with asp.net templates, but you can install it using nugget package manager and can also by using Package Manager Console..
PM> Install-Package Microsoft.AspNet.Identity
The ASP.NET membership system was introduced with ASP.NET 2.0 back in 2005, and since then there have been many changes in the ways web applications typically handle authentication and authorization. ASP.NET Identity is a fresh look at what the membership system should be when you are building modern applications for the web, phone, or tablet.
The ASP.NET Identity system is designed to replace the previous ASP.NET Membership and Simple membership system.


ASP.NET Identity Benefits

One ASP.NET Identity system
·         ASP.NET Identity can be used with all of the ASP.NET frameworks, such as ASP.NET MVC, Web
Forms, Web Pages, Web API, and SignalR.
·         ASP.NET Identity can be used when you are building web, phone, store, or hybrid applications.
Ease of plugging in profile data about the user
·         You have control over the schema of user and profile information. For example, you can easily enable the system to store birth dates entered by users when they register an account in your application.



Persistence control
·         By default, the ASP.NET Identity system stores all the user information in a database. ASP.NET Identity
·         Uses Entity Framework Code First to implement all of its persistence mechanism.
·         Since you control the database schema, common tasks such as changing table names or changing the data type of primary keys is simple to do.
·         It's easy to plug in different storage mechanisms such as SharePoint, Azure Storage Table Service, NoSQL databases, etc., without having to throw System.NotImplementedExceptions exceptions.
Unit testability
·         ASP.NET Identity makes the web application more unit testable. You can write unit tests for the parts of your application that use ASP.NET Identity.
Role provider
·         There is a role provider which lets you restrict access to parts of your application by roles. You can easily create roles such as "Admin" and add users to roles.
Claims Based
·         ASP.NET Identity supports claims-based authentication, where the user's identity is represented as a set of claims. Claims allow developers to be a lot more expressive in describing a user's identity than roles allow. Whereas role membership is just a Boolean (member or non-member), a claim can include rich information about the user's identity and membership.
Social Login Providers
·         You can easily add social log-ins such as Microsoft Account, Facebook, Twitter, Google, and others to your application, and store the user-specific data in your application.
OWIN Integration
·         ASP.NET authentication is now based on OWIN middleware that can be used on any OWIN-based host. ASP.NET Identity does not have any dependency on System.Web. It is a fully compliant OWIN framework and can be used in any OWIN hosted application.
·         ASP.NET Identity uses OWIN Authentication for log-in/log-out of users in the web site. This means that instead of using FormsAuthentication to generate the cookie, the application uses OWIN CookieAuthentication to do that.
NuGet package
·         ASP.NET Identity is redistributed as a NuGet package which is installed in the ASP.NET MVC, Web Forms and Web API templates that ship with Visual Studio 2017. You can download this NuGet package from the NuGet gallery.
·         Releasing ASP.NET Identity as a NuGet package makes it easier for the ASP.NET team to iterate on new features and bug fixes, and deliver these to developers in an agile manner.

Post a Comment

0 Comments