simplemembership

Membership.DeleteUser is not deleting all related rows of the user

江枫思渺然 提交于 2019-12-06 04:23:15
Membership.DeleteUser() manages to delete the userprofile of the user I am deleting. Why does it not also delete it's information stored in webpages_membership . I am not using roles at this point in time so keep that in mind for your answers. I ran a test and verified that SimpleMembershipProvider.DeleteUser does not work as advertised. According to the documentation: This method deletes the entry in the membership account table (by default, webpages_Membership ). If deleteAllRelatedData is true, all user data that is stored in the user table is also deleted. But in my test I set

What encryption does MVC4 use?

为君一笑 提交于 2019-12-05 22:06:06
How do we find out what encryption MVC4 uses? I notice there is an option for a SALT but this also seems not to be used in the WebSecurity() module. I would like to know the standard used and if it is easily possible to upgrade to the latest SHA According to the below link the Default Hashing Algorithm Is Now HMACSHA256 : http://www.asp.net/whitepapers/aspnet4/breaking-changes Default Hashing Algorithm Is Now HMACSHA256 ASP.NET uses both encryption and hashing algorithms to help secure data such as forms authentication cookies and view state. By default, ASP.NET 4 now uses the HMACSHA256

ASP.NET MVC Remember me

北城余情 提交于 2019-12-05 19:06:01
I've got a project based in ASP.NET MVC 4 that simple authentication. I'm trying to get my site to automatically log the user in when they check the remember me checkbox. However I'm having problems getting this working. After closing down the browser and reopening it the user is never logged in. After checking ( http://forums.asp.net/t/1654606.aspx#4310292 ) I've added a machine key in, generated by IIS. I've set automatically generate at runtime and generate a unique key for each application have both been disabled and I've Generated Keys). Unfortunately this hasn't worked. Looking at

MVC Code First: One-to-many relationship between own model and SimpleMembership user

主宰稳场 提交于 2019-12-05 14:16:49
I am currently working on an event calendar website and I am still a novice when it comes to ASP.NET. I am using the MVC4 Framework, as well as the EntityFramework (CodeFirst) and the SimpleMembershipProvider, which comes with the MVC4 template. I am also using Migrations - If that is from any interest. What I've got so far I do currently have two models, with a one-to-many relationship, which work just fine: _Events.cs (had to name it that way, because event is reserved) public class _Event { public int _EventId { get; set; } public string Name { get; set; } public DateTime StartDate { get;

How do I manually “log a user in” using WebSecurity + SimpleMembership?

夙愿已清 提交于 2019-12-05 09:13:29
I'd like to use WebSecurity+SimpleMembership, but implement the ability to (optionally) login users via a custom/alternative authentication method. WebSecurity.Login only has one method signature, which requires both a username and a password. I'd like to skip the password check, e.g.: if (MyCustomAuthenticationMethod.Authenticate(username, customData)) { WebSecurity.Login(username); // Login without password check, method doesn't exist though } I assume custom-auth-methods are possible given OAuthWebSecurity exists, but I'm not sure how to go about implementing my own. Kek Well, you could

code first membership provider

匆匆过客 提交于 2019-12-05 04:41:51
问题 How can I integrate EF 5.0 with membership provider using code first? I have my own database schema which I want to use for registration of users etc. 回答1: You should take a look at the SimpleMembershipProvider It is very easy to use it together with EF. Update For MVC4 I would start with the blank template. you need WebSecurity.InitializeDatabaseConnection to set up the database. WebSecurity.InitializeDatabaseConnection("DefaultConnection", "Users", "Id", "UserName", true); It takes as

Using MySQL 5 , Simple Membership Provider, ASP.NET MVC4 with Entity Framework 5

别等时光非礼了梦想. 提交于 2019-12-05 02:50:59
问题 I am trying to: use Simple Membership provider based authentication with MySQL using ASP.NET MVC 4 default web application configured to use MySQL using the tutorial given at: http://www.nsilverbullet.net/2012/11/07/6-steps-to-get-entity-framework-5-working-with-mysql-5-5/ and here at ASP.NET MVC 4 EF5 with MySQL I am using MySQL Connector 6.6.4 with EF 5.0 and Visual Studio 2012 and working with an ASP.NET MVC 4 Internet application template. The errors i am facing is this: Server Error in '

Using [Authorize] without SimpleMembershipProvider

元气小坏坏 提交于 2019-12-04 19:31:45
Is there a way to use... [Authorize(Roles: "Administrator")] public class SomeController : Controller { ... } ...with my own Roles database table, without using SimpleMembershipProvider ? My Users and Roles model classes: [Table("Users")] public class UserModel { [Key] public Int32 ID { get; set; } [Required] public String Name { get; set; } [Required] public String Password { get; set; } [Required] public virtual RoleModel Role { get; set; } } [Table("Roles")] public class RoleModel { [Key] public Int32 ID { get; set; } [Required] public String Name { get; set; } public virtual ICollection

Editing user profile details

人走茶凉 提交于 2019-12-04 14:51:45
问题 How to create action and views for editing user custom informations? Authorization is based on membership created by VS with MVC 4 project. I've added additional columns, such as FirstName etc. I needed and registration works correctly, but I don't know how to get this attributes to show in view for @Html.EditorFor and to save changes in database (table UserProfile). Many thanks for every tip. Created model for edition: public class UserProfileEdit { [Required] [Display(Name = "First name")]

Do I need to use `[ValidateAntiForgeryToken] and @Html.AntiForgeryToken()` on all my pages?

醉酒当歌 提交于 2019-12-04 10:29:09
问题 All my project's page need authentication.. And Normally I dont use [ValidateAntiForgeryToken] and @Html.AntiForgeryToken() on my Controller and View.. Only login page has it.. What are they [ValidateAntiForgeryToken] and @Html.AntiForgeryToken() ?? Do I need to use them?? Which cookieless I have to use?? My web.config's part like this; <authorization> <deny users="?" /> </authorization> <authentication mode="Forms"> <forms loginUrl="~/User/Login" timeout="30" cookieless="UseDeviceProfile"