What is ASP.NET Identity’s IUserSecurityStampStore interface?

Looking at ASP.NET Identity (new membership implementation in ASP.NET), I came across this interface when implementing my own UserStore: //Microsoft.AspNet.Identity.Core.dll namespace Microsoft.AspNet.Identity { public interface IUserSecurityStampStore<TUser> : { // Methods Task<string> GetSecurityStampAsync(TUser user); Task SetSecurityStampAsync(TUser user, string stamp); } } IUserSecurityStampStore is implemented by the default EntityFramework.UserStore<TUser> which essentially get and set the TUser.SecurityStamp property. … Read more

ASP.NET Identity DbContext confusion

A default MVC 5 App comes with this piece of code in IdentityModels.cs – this piece of code is for all the ASP.NET Identity operations for the default templates: public class ApplicationDbContext : IdentityDbContext<ApplicationUser> { public ApplicationDbContext() : base(“DefaultConnection”) { } } If I scaffold a new controller using views with Entity Framework and create … Read more

Do I need a Global.asax.cs file at all if I’m using an OWIN Startup.cs class and move all configuration there?

Let’s say for example in a brand new ASP.NET MVC 5 application made from the MVC with Individual Accounts template, if I delete the Global.asax.cs class and move it’s configuration code to Startup.cs Configuration() method as follow, what are the downsides? public partial class Startup { public void Configuration(IAppBuilder app) { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); … Read more

ASP.NET MVC 5 – Identity. How to get current ApplicationUser

I have an Article entity in my project which has the ApplicationUser property named Author. How can I get the full object of currently logged ApplicationUser? While creating a new article, I have to set the Author property in Article to the current ApplicationUser. In the old Membership mechanism it was simple, but in the … Read more