Introducing ASP.NET Identity – A membership system for ASP.NET applications
Now when creating a new web application with ASP.NET 4.5, we have the new "ASP.NET Identity".
I manage to let my application to use my MSSQL database with the build in register/login/change password functions, but I am not sure how to do other operation like old days ( especially the "ASP.NET Configuration" is gone). Since this is something new, I failed to find any nice guide or I was thinking wrongly.
- the "[dbo].[AspNetUsers]" now has the [Id] in nvarchar(128), not the uniqidentifier, but still in GUID format
- Membership.GetUser().ProviderUserKey is no longer working, how do I get the Id? (get username by User.Identity.Name then query the [dbo].[AspNetUsers]?"
- How to create (manage) roles beside manipulate the database directly? (like the previous System.Web.Security.Roles.CreateRole method)
etc
it would be best if anyone can provide link for a detail introduction about how to implement this "ASP.NET Identity"
Thanks a lot..
Update
I found the Id can be retrived by:
(new System.Linq.SystemCore_EnumerableDebugView(((System.Security.Claims.ClaimsPrincipal)(((System.Web.UI.Page)(this)).User)).Claims)).Items[0].Value
it is in the claim.. but looks not very efficient.
Best Answer
I'm in the same boat. I have found a cleaner way to get the userid