CreateUserIdenityAsync returns “UserId not found” exception for custom IdentityUser
I’m following along the bitoftech tutorial about creating Identity and role based claims with JWT. My application user is a custom User table with int PK.
I’m following along the bitoftech tutorial about creating Identity and role based claims with JWT. My application user is a custom User table with int PK.
I’m using Identity 2.1 to handle the user roles in my asp.net application. So far so good, i created new context extending from IdentityDBContext, extending the IdentityUser and IdentityRole to add a couple of new fields. However, whenever im trying to add a user to a specific role using the UserManager im getting The entity type IdentityRole is not part of the model for the current context.. So there seem to be something wrong with the user-role relationship, here is my code so far for reference:
I installed the VS2013 final bits that were released yesterday, and I’m trying to get an example working where I enable an external Facebook login. My first question:
I’m very noob in asp.net area. So my question maybe got answered anywhere in the internet but neither of them I understand the flow creation. Here is the question.
I just spent the last two days researching and implementing the new ASP.NET Identity system with my existing database. More on that here: Integrating ASP.NET Identity into Existing DbContext.
I have a very simple table that has UserID as int Password as text and Roles as text(comma separated).
Can i customize ASP.NET Identity structure to use it with my table?
I implemented Microsoft Identity and JWT in my web api,
a client can login and get a JWT token and store it in the application.
since the expiration of the token the user can access the the server,
but if I remove a user from my database, the removed user still has its token and can access the web api,
how can I check the validation of the user?
Two-Part Question.
I would like to extend UserValidator or something similar in Asp.net Identity 2.0 to not only check for unique email but also a unique value of my choosing. Example of what I would like to do with Alias below. Is this possible or do I have to write a check everywhere I can update Alias?
I have found many tutorials for adding columns to the Identity tables (which I have successfully moved to the application database) with database migrations however my understanding is this is not applicable in database fist projects. So…how do I add columns to the aspnetusers table in a database first project?