simplemembership

SimpleMembership with custom database schema in ASP.NET MVC 4

て烟熏妆下的殇ゞ 提交于 2019-11-26 22:41:26
问题 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 =

User.IsInRole doesn't work

别等时光非礼了梦想. 提交于 2019-11-26 21:09:29
问题 I have ASP.NET MVC 4 application. I use Simple Membership Provider allowing to tick remember me checkbox under login form. If ticked, persitent cookie .ASPXAUTH is created which expires 100 days from login date. And everything works fine, apart of main menu of the application. Some parts of the menu are available for admin users only. I use: @if (User.IsInRole("Administrator")) { @Html.Partial("_MainMenuPartial") } to lock them from being rendered for regular user. This approach works fine

SimpleMembershipProvider not working

风流意气都作罢 提交于 2019-11-26 19:30:39
问题 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

Role based authentication in the new MVC 4 Internet template using simplemembership

我的梦境 提交于 2019-11-26 19:27:07
I like the new simplemembership feature in MVC 4 internet template with links to OAuth for external logins in VS 2012 RTM. For the most part authentication feature are working. However even after spending over 8 hours on this I am unable to implement roles based authorization to work on my controllers. SimpleMembership is turning out to be anything but simple. I have searched stackoverflow, googled and have read the latest by John Galloway , tried many suggestions and still have not been able to resovle this issue. It all started with getting Sql connection error and could not figure out why

How do I manage profiles using SimpleMembership?

橙三吉。 提交于 2019-11-26 19:06:13
问题 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

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

非 Y 不嫁゛ 提交于 2019-11-26 18:54:19
问题 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

Using SimpleMembership with EF model-first

谁说胖子不能爱 提交于 2019-11-26 15:48:27
问题 Can SimpleMembership be used with EF model-first ? When I try it, I get "Unable to find the requested .NET Framework Data Provider" when I call WebSecurity.InitializeDatabaseConnection. To put it another way: I can't get the call to WebSecurity.InitializeDatabaseConnection to work when the connection string employs the System.Data.EntityClient provider (as it does when using the model-first paradigm). To repro the issue, create an MVC 4 app, and replace the code-first UserProfile entity class

How to create custom additional fields in UserProfile in MVC4

天大地大妈咪最大 提交于 2019-11-26 15:05:19
问题 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]

Role based authentication in the new MVC 4 Internet template using simplemembership

邮差的信 提交于 2019-11-26 06:58:52
问题 I like the new simplemembership feature in MVC 4 internet template with links to OAuth for external logins in VS 2012 RTM. For the most part authentication feature are working. However even after spending over 8 hours on this I am unable to implement roles based authorization to work on my controllers. SimpleMembership is turning out to be anything but simple. I have searched stackoverflow, googled and have read the latest by John Galloway, tried many suggestions and still have not been able