simplemembership

How to make WebSecurity.Login to login using username or email?

℡╲_俬逩灬. 提交于 2019-11-27 20:05:57
问题 WebSecurity.Login in simplemembership take username and password, how to make it to login the user using username or email instead of just username?, to make the user free to enter his email or username to login. 回答1: You could inherit from the SimpleMembershipProvider and just override the ValidateUser method like this. public class ExtendedSimpleMembershipProvider : SimpleMembershipProvider { public override bool ValidateUser(string login, string password) { // check to see if the login

SimpleMembershipProvider not working

陌路散爱 提交于 2019-11-27 18:34:59
I started a new internet project with VS2012 and am trying to just restructure my project a bit and I can't seem to keep the SimpleMemberhsipProvider working. Basically, all I've done is move the models objects into a core project along with a couple other items. I've implemented Ninject and am trying to abstract Entity a bit by using a repository pattern to get my data. I really don't feel as though I've changed much with the current project, but for some reason when I start the application now I get: {"The Role Manager feature has not been enabled."} The ActionFilter that is supplied by the

SimpleMembership with custom database schema in ASP.NET MVC 4

只谈情不闲聊 提交于 2019-11-27 18:29:53
I want to enable the ASP.NET MVC 4's SimpleMembership API to integrate with my own database schema. I have a plain and simple table in my database called Users with these fields: Id Name Password Email IsDeleted I have already configured the SimpleMembership API to use my database: WebSecurity.InitializeDatabaseConnection("MyStuff", "Users", "Id", "Name", autoCreateTables: true); And I can insert a user too: WebSecurity.CreateUserAndAccount(model.UserName, model.Password, new { IsDeleted = false, Email = "sampledata@gmail.com" }); However, the Password field (or it's hash) is not inserted into

How do I manage profiles using SimpleMembership?

吃可爱长大的小学妹 提交于 2019-11-27 17:38:16
I have an ASP.NET MVC 4 site based off the internet template. I am using the SimpleMembership which i set up with that template. I can modify the Users table which has been creted for me but I am unsure as to the "correct" way to modify the extra fields I have added. I want Fullname, Email etc and have added them to the user table but there appears no way to update through the SimpleMembership WebSecurity.* static methods. Are you supposed to just update those properties yourself using EF outside of the SimpleMembership API? 1 - You need to enable migrations, prefereably with EntityFramework 5

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

…衆ロ難τιáo~ 提交于 2019-11-27 17:07:50
We have an existing application that was build on ASP.NET MVC 4 & Web API. The admin parts of the site use Simple Membership. I'm interested in upgrading the application to MVC 5 / Web API 2, to take advantage of some of the new features that have been added. But it looks like they might be incompatible. Specifically, after installing the RC packages from NuGet into one of the projects in my solution, and updating the web.config information , the application starts dying during startup on the line that calls WebSecurity.InitializeDatabaseConnection() , with this exception:

How to create custom additional fields in UserProfile in MVC4

删除回忆录丶 提交于 2019-11-27 10:06:13
I faced with new ASP MVC 4 feature, it shipped with new membership db schema and new initialization. In mvc 3 and old versions developer able to create custom user profile fields using specifications in web.config, but now i faced with method in filters namespace in default mvc 4 project: WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); and user profile table: [Table("UserProfile")] public class UserProfile { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int UserId { get; set; } public

SimpleMembershipProvider MinRequiredPasswordLength always returns 0 despite it being defined as 6 in Web.config membership provider section

梦想与她 提交于 2019-11-27 07:28:13
问题 I switched to SimpleMembershipProvider in an ASP.NET MVC 4 app. Everything else is working great but there's this problem... When I try this code: var password = Membership.GeneratePassword(Membership.MinRequiredPasswordLength, 0); MinRequiredPasswordLength is always 0. The settings defined in the membership provider's Web.config section are not being read. Here's the Membership default provider Web.config section: <membership defaultProvider="AspNetSqlMembershipProvider"> <providers> <clear

How can I customize simple membership provider to work with my own database ASP.NET mvc 4

倖福魔咒の 提交于 2019-11-27 05:15:34
问题 I’m exploring ASP.NET MVC 4 these days. I will be pleased if someone can help by answering my question . I am building an academic project "Project management and support system" . I have designed my own database , I have my own tables for the users in my database (two kinds of users : Employee who will execute tasks , and a client who assign/hire for tasks ) ,I was about creating a new membership provider but I realized that "It's a waste of time - reinventing the wheel". Now , I am building

ASP.NET Identity vs Simple membership Pros and Cons?

核能气质少年 提交于 2019-11-27 00:28:15
问题 In MVC4 we had Simple Membership . My opinion is that Simple Membership was a good Identity Model tried and tested with good documentation and didn't need to be fixed but simply needed an upgrade in terms of Email Verification/ Password Reset and all other stuff that we normally have to deal with when building an app. However the new ASP.NET Identity model seems achieve Something of sorts that Vista achieved over XP. I mean AspnetUserClaims and AspnetLogins could have been bunched together as

How do I use my own database with SimpleMembership and WebSecurity? What is MVC4 security all about?

試著忘記壹切 提交于 2019-11-26 23:30:24
I've read everything on this topic I could find, including MSDN articles and SO posts, but I'm still very lost and confused. Questions Please answer the following (briefly, if possible): What is SimpleMembership/SimpleMembershipProvider ( WebMatrix.WebData ) and what is it/are they responsible for? What is WebSecurity ( WebMatrix.WebData )? What is the Membership ( System.Web.Security ) class? Why does MVC4 create a UserProfile table and a webpages_Membership table? What are they for and what is the difference? What is the UserProfile class that MVC4 creates? What is the UsersContext class?