Is ASP.NET MVC 5 incompatible with the WebMatrix SimpleMembershipProvider?

WebMatrix is compatible with MVC 5. What I did was to take an empty MVC 5 project and incorporate WebMatrix SimpleMembershipProvider into it using SimpleSecurity, an open source project that decouples SimpleMembership from your MVC application. So far I am able to create the database, seed it, and log in and out. I plan on … Read more

How to change type of id in Microsoft.AspNet.Identity.EntityFramework.IdentityUser

Using a Stefan Cebulak’s answer and a Ben Foster’s great blog article ASP.NET Identity Stripped Bare I have came up with below solution, which I have applied to ASP.NET Identity 2.0 with a generated by Visual Studio 2013 AccountController. The solution uses an integer as a primary key for users and also allows to get … Read more

Can’t get UserManager from OwinContext in apicontroller

I really misunderstood your question earlier. You are just missing some using statements, I think. The GetOwinContext().GetUserManager<ApplicationUserManager>() is in Microsoft.AspNet.Identity.Owin. So try add this part: using Microsoft.AspNet.Identity.Owin; using Microsoft.AspNet.Identity; // Maybe this one too var manager = HttpContext.Current.GetOwinContext().GetUserManager<UserManager<User>>();

How override ASP.NET Core Identity’s password policy

It’s sooooo simple in the end … No need to override any class, you have just to configure the identity settings in your startup class, like this : services.Configure<IdentityOptions>(options => { options.Password.RequireDigit = false; options.Password.RequiredLength = 5; options.Password.RequireLowercase = true; options.Password.RequireNonLetterOrDigit = true; options.Password.RequireUppercase = false; }); Or you can configure identity when you add … Read more

SignInManager,what it is and how,when to use?

Disclaimer: I am confused by model used in ASP.NET identity myself and what I say is my understanding of things, that may be inaccurate (I might also be stating obvious things, so I apologize). Also, I was playing with Asp.Net Core’s identity recently which is slightly different compared to what was available for Asp.Net 4, … Read more

Registering Web API 2 external logins from multiple API clients with OWIN Identity

Update: things have changed since I wrote this post in January: MSFT released their official OpenID connect client middleware and I worked hard with @manfredsteyer to adapt the OAuth2 authorization server built in Katana to OpenID connect. This combination results in a far easier and far more powerful solution that doesn’t require any custom client … Read more

Updating user data – ASP.NET Identity

OK… I spent hours trying to figure why userManager.updateAsync would not persist the user data that we edit … until I reached the following conclusion: The confusion arises from the fact that we create the UserManager in one line like this: var manager = new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new MyDbContext())); …then we use manager.UpdateAsync( user ); but … Read more

How to implement custom authentication in ASP.NET MVC 5

Yes, you can. Authentication and Authorization parts work independently. If you have your own authentication service you can just use OWIN’s authorization part. Consider you already have a UserManager which validates username and password. Therefore you can write the following code in your post back login action: [HttpPost] public ActionResult Login(string username, string password) { … Read more

How do I define the password rules for Identity in ASP.NET 5 MVC 6 (vNext)?

I actually ended up figuring this out, it turns out you need to supply AddDefaultIdentity with a suitable lambda expression that configures the IdentityOptions it provides. This is done inside the ConfigureServices method within the Startup class, like so: public class Startup { public void ConfigureServices(IServiceCollection services) { // Add Identity services to the services … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)