Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

Microsoft.AspNet.Identity makes me crazy

$
0
0

Hi,

I need to implement  Microsoft.AspNet.Identity on an existing MVC project. User store and related features are custom (existing classes, DAL, etc), I cannot use the EF integrated library.

My work is based on http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity and also http://www.asp.net/identity/overview/extensibility/change-primary-key-for-users-in-aspnet-identity (my Users as Int32 based).

I've implemented IUser and IRole on my existing User and Role classes. I've implemented a custom UserStore and loaded it in owinContext. But when I try

 Await UserManager.CreateIdentityAsync(validationResult.User, DefaultAuthenticationTypes.ApplicationCookie)

I have a System.NullReferenceException: Object reference not set to an instance of an object.

I noticed that it executes FindByIdAsync and GetRolesAsync from my UserStore, and they are ok. I cannot understand what's wrong, and how can I make this crazy framewok work... :(


Viewing all articles
Browse latest Browse all 8156

Trending Articles