سؤال

What are the basic functionality which it provides? Specifically for the person who has never used asp.net built in stuff.

The MSDN tutorial is confusing me a lot. Claims, OWIN,etc are going above my head.

What I can make out of all this is - The Identity framework helps me to manage my application plus social logins. It handles my cookie, etc.

What if I have just one role in my application - just the plain user? Should I go for the Identity then or I should implement my own custom thing?

هل كانت مفيدة؟

المحلول

If you are starting from scratch, build a sample MVC project with individual membership option, which will create the following components for you:

  • Login module that creates and manages authentication cookies
  • Simple database to store basic user data (credentials, name)
  • EF code to interact with the database

This will most likely meet your use case for a user without roles and attributes.

OWIN really has nothing to do with authentication, it is a new spec for building web apps. The login module happens to be implemented according to this spec and it sounds cool, so Microsoft likes to throw this term around a lot.

If you are not planning to have authorization logic in the app, then you don't need to worry about Claims. Claims is another term for user attributes (login, name, roles, permissions). The Claims collection will be populated by the framework, but you most likely won't use it. If you need just the user id/name, the old ASP.NET interfaces are still there to get this data.

As far as implementing your own, I've seen people here ditching the database and EF code, especially if they already have an existing user store. You just need to implement a credential verification logic against your store. You don't want to build your own cookie management, though. Use the login module provided by Microsoft or well established third party systems (SiteMinder, Tivoli, etc.)

Looks at this open source project for a good alternative to ASP.NET Identity.

This is a very well put together tutorial that explains many of these concepts, you can get a free trial to the site to see it.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top