membership-provider

What is a good way to extend .Net Membership to track user logins

妖精的绣舞 提交于 2019-11-29 17:05:39
As far as I can tell, the basic implementation of .Net membership records lastuserlogin but does not track each login, something I need to do now. I've done some research and I'm pretty sure one approach is to create a custom class that extends the current provider with this functionality, and adding an event table to the schema to record each login. I've seen a few articles on this - the closest probably being this one from Scott Mitchell http://dotnetslackers.com/articles/aspnet/Tracking-User-Activity.aspx but it's from Nov 2008 and I'm curious if anyone can point me towards a better

Saving an email change within the default Membership Provider in ASP.NET MVC

时间秒杀一切 提交于 2019-11-29 09:58:33
I am trying to set and save an email change using within the Membership Provider in ASP.NET MVC 3. I do not know how to properly set and change the email property within the Membership Provider. MSDN seems to suggest the MembershipUser.Email Property as it, "Gets or sets the e-mail address for the membership user," but I do not know how to get this to function properly. I am attempting to use this code: // change email MembershipUser u = Membership.GetUser(User.Identity.Name); u.Email = email; // Is this working as expected? u.Save(); // this line doesn't do anything - what should it be? db

ASP.NET MVC Custom Membership Provider - How to overload CreateUser?

喜欢而已 提交于 2019-11-28 22:10:11
I'm trying to build Custom Membership Provider. I would like to capture additional information (First Name and Last Name) during the registration and I'm not using usernames (email is a login). In my custom Membership Provider I'm trying to overload CreateUser method like this: public override MyMembershipUser CreateUser(string firstName, string lastName, string email, string password) { ... } But when I want to call it from the Account controller: [HttpPost] public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user MembershipCreateStatus

How do you handle Membership/Roles when using NHibernate?

馋奶兔 提交于 2019-11-28 19:21:53
问题 I'm about to kick off a new project using NHibernate and ASP.Net MVC and have come upon the question of membership. I'm wondering if I should use a 3rd party NHibernate Membership/Role provider, create my own, or just skip the providers all together. So far I've looked at: Manuel Abadia's NHCustomProviders - It seems like a lot of configuraton, not sure if I want to put all that in my web.config. Leo Vildosola's NHibernateProvider - Which doesn't appear to be supported by the project owner

How do I setup a Membership Provider in my existing database using ASP.NET MVC?

醉酒当歌 提交于 2019-11-28 19:12:35
For some reason, the idea of setting up Membership in ASP.NET MVC seems really confusing. Can anyone provide some clear steps to setup the requisite tables, controllers, classes, etc needed to have a working Membership provider? I know that the Demo that MVC ships with has an Accounts controller. However, should I be using this in my own project? What do I need to get my existing database ready if so? If not, how do I learn what I need to do to implement a membership provider? Check out this step by step blog on how to set up Membership provider in your asp.net mvc project. The sdk tool you

“Membership.Provider must be an instance of ExtendedMembershipProvider”

[亡魂溺海] 提交于 2019-11-28 13:30:27
I'm writing a MVC4 Website using Microsoft Visual Studio express 2012 for web. Whenever I run "Update-Database" in the Package Manager Console, the following Exception occurs: To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider". This is my Seed method: protected override void Seed(GNSystem.Models.DataContext context) { context.Forums.AddOrUpdate( new Forum { ForumName = "Hello" }, new Forum { ForumName = "World" }, new Forum { ForumName = "!" } ); context.UserProfiles.Add(new UserAccount { UserName = "Gilad", EMail = "gilad.doom@gmail.com

What is a good way to extend .Net Membership to track user logins

 ̄綄美尐妖づ 提交于 2019-11-28 10:47:01
问题 As far as I can tell, the basic implementation of .Net membership records lastuserlogin but does not track each login, something I need to do now. I've done some research and I'm pretty sure one approach is to create a custom class that extends the current provider with this functionality, and adding an event table to the schema to record each login. I've seen a few articles on this - the closest probably being this one from Scott Mitchell http://dotnetslackers.com/articles/aspnet/Tracking

ASP.NET Membership - login works locally, fails on Azure

别等时光非礼了梦想. 提交于 2019-11-28 05:27:39
I'm working on an MVC3 site, and I've got a puzzling problem with ASP.NET Membership. I'm using System.Web.Providers 1.0.1 connected to a SQL Azure database. As it is now, the same username/password that logs me in when running under the Compute Emulator fails when running under Azure proper. I can see that it's using the right database, as the Failed Password Attempts counter in the membership database is being updated. I tracked it down, thanks to some info in this article by David Hoerster . The problem is that the default password hashing algorithm on Azure is different from the .NET 4.0

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

爱⌒轻易说出口 提交于 2019-11-28 04:01:28
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 a membership model on ASP.NET MVC4 using SimpleMembership (It's the future of membership services for

How do you change a hashed password using asp.net membership provider if you don't know the current password?

痞子三分冷 提交于 2019-11-28 03:27:05
Problem, there's no method: bool ChangePassword(string newPassword); You have to know the current password (which is probably hashed and forgotten). mcqwerty This is an easy one that I wasted too much time on. Hopefully this post saves someone else the pain of slapping their forehead as hard as I did. Solution, reset the password randomly and pass that into the change method. MembershipUser u = Membership.GetUser(); u.ChangePassword(u.ResetPassword(), "myAwesomePassword"); You are not able to change the password if the requiresQuestionAndAnswer="true" I got the work around for this Created two