Building Modern Web Apps: (03) ASP.NET Identity

Sign in to queue

Description

Explore the new ASP.NET Identity system. Learn how to migrate your existing membership data to the new Identity system and how to integrate with other membership systems.

Full course outline:

Embed

Download

Download this episode

Download captions

The Discussion

  • User profile image
    Luiz Bicalho

    I saw in Stuart Leeks blog that the azure tables asp.net identity implementation isn't for production, does Microsoft have plans to create an azure tables implementation to be used in production?

  • User profile image
    BrunoLM

    What if I don't want code-first? And if I already have a database with a different User table?

  • User profile image
    Abdella

    This was an excellent session, however I would really had liked if you would have shown an example of how to give the users the ability to create a user profile at the site using a form. 

  • User profile image
    pcpgmr

    The leeks should have been discussed first, but thank you for the detailed help. Good series. Do you have the code solution for this as following along 2013 and .NET 4.5.1 does not yield same results.

  • User profile image
    rustd

    @Luiz, there are quite a few azure table storage implementations for Identity which you can use to build upon. Since Storing data in Azure Table Storage is domain specific, you would need to customize the provider to suite your application.

  • User profile image
    rustd

    @BrunoLM you can plugin your own UserTable into ASP.NET Identity. If you do not want to use Entity Framework Code First then you would have to write your own Custom provider which can work with the User Table in the database.

  • User profile image
    rustd

    @Abdella you can build up the form yourself to customize the profile data you want for the user. The following article shows how you can add more profile data and build up a form as well http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

  • User profile image
    rustd

    @pcpgmr: what code solution are you looking for?

     

  • User profile image
    Eric

    Scott, at the beginning of the video you mention a talk on Friday.azure.com with Vittorio B that would be coming. I can't seem to find it. Is it up yet? If so, can you post a link?

    Thanks.

  • User profile image
    patrickCh9

    This looks great, but near the beginning of this video, you mention that we can add other social media logins, but I have been unable to find any documentation as to how to do this.  if I want to use my own MVC5 website, call it site IdentityProviderSite, as an identity provider, so that users can log in to another of my MVC5 sites, call it Site A, what code do I need to write first of all in Identity ProviderSite, and secondly in Site A (so that users can log in to site A via IdentityProviderSite)?

    Many thanks

  • User profile image
    patrickCh9

    Also, the code you give to access custom properties that have been added to the user's profile no longer works in websites created (e.g. MVC5) under Visual Studio 2013 Update 2 CTP:

    var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));

    gives a compile error saying that ApplicationUser in new UserManager<ApplicationUser>: "this argument type is not within its bounds".  (This seems to be a change introduced in the move from version 2 to version 2.0.2 of Microsoft.Owin.Security?). 

    How can we access the custom properties in the Update 2 CTP template projects?

    Also, even before Update 2, why create a new UserManager, rather than the UserManager which is a member of the AccountController class?

    Thanks

  • User profile image
    patrickCh9

    OK, I think I've found a solution, although Visual Studio 2013 Update 2 CTP implies visually that there is a compile problem (it gives a red squiggly line, saying Unknown method FindById(string)) , even though the code actually runs:

    var currentUser = UserManager.FindById(User.Identity.GetUserId());

    This uses the AccountController's UserManager property. 

  • User profile image
    giogama

    Hi,

    How do I remove all ASP.Net Identity from Web Project, e put all thoses classes in a Class Library Project. Do you have any tutorial for this?

  • User profile image
    orhanveli

    @BrunoLM: you can make your own like this.

    implementation: http://www.asp.net/identity/overview/extensibility/implementing-a-custom-mysql-aspnet-identity-storage-provider

    I made a NHibernate implementation for testing and it works just fine

  • User profile image
    DevMec

    Hi,

    Very good article, but I have questions:

    1- Can you explain more about claims in asp.net.Idendity ?

    2- What is the best way to implement the user interface for CRUD the Color and FisrtName of a user ?

    Best Regards,

  • User profile image
    Fadi

    Hi,

    how can we list the user name in a view ??
    how can we link the AspNetUser table with other table we create in our database so we can use the user name and there roles

Add Your 2 Cents