Owin Signin Manager requires fields we do not use, is it possible to get rid of this error? RRS feed

  • Question

  • User1318453554 posted

    Before I strip out Owin and write our own sign in manager, is it possible to get rid of this error?

    Invalid column name 'PhoneNumber'.

    Invalid column name 'PhoneNumberConfirmed'.

    Invalid column name 'TwoFactorEnabled'.

    Invalid column name 'LockoutEndDateUtc'.
    Invalid column name 'LockoutEnabled'.

     I deleted the 5 columns above because they are null, or not used in our application. After doing so, the SignInManager stopped working.

    Is there any way to have it ignore these fields since we do not use any of them?

    In a related question, there are 4 other tables we do not use at all, AspNetRoles, AspNetUserClaims, AspNetUserLogins, AspNetUserRoles, can I get rid of these tables and still use the sign in manager, or do I have to write my own to get rid of these tables?

    We only use the AspNetUsers table, all these other tables are just not needed in our app, so why does Owin require them?


    If you want something done right, you have to do it yourself is what I am coming to the conclusion of.

    Thursday, August 25, 2016 3:14 PM


All replies

  • User-491950272 posted


    Identity is an Authentication\Authorization framework in ASP.NET. What you are trying to do is to create a custom user store. In that case, you have to create a custom UserManager, a Custom RoleManager and other factors that you need in your application. You can view this post to learn more about custom storage providers. In This MVA course, Adam Tuliper shoud an implementation of a Custom User Store (RavenDb example).

    I personally recommend you to not to do this customization as it requires extra effort and violate integrated Identity security. I myself has search for 2-3 months but eventually I stick with the default one.

    Thursday, August 25, 2016 7:41 PM
  • User1318453554 posted

    I won't do that, I will just create a sign in manager. Owin uses a lot of things that are overkill for my needs.

    Thursday, August 25, 2016 7:42 PM
  • User-2057865890 posted

    Hi Tempapoker,

    It seems that here you need to delete the inheritance of ApplicationDbContext and IdentityDbContext.
    ApplicationDbContext inherits from IdentityDbContext<TUser>.
    Here below the links may helps you to solve your issue in which other users have a same issue like you.

    To not use ASP.NET Identity Framework 2.0 default tables


    ASP.NET Identity DbContext confusion



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, August 26, 2016 11:00 AM
  • User1318453554 posted

    Thanks for your answer, it is probably the right answer, but my entire app started breaking.

    I didn't write my current project, I took it over from another company and it was too dependent on things.

    I would have never used it Owin to start with, so I will just leave it alone.

    This thread can be closed.

    Friday, August 26, 2016 11:35 AM