simplemembership

Turning off only the Role Provider in SimpleMembership

佐手、 提交于 2019-12-14 02:23:41
问题 I have read a ton of different posts and tutorials and couldn't find an answer to this specific need. I'd like to use the SimpleMembership provider in my ASP.NET MVC app, but I would like to turn the Role provider off (OAuth too since I will not be using it). That means that I would like the SMP to create only webpages_Membership table on initialization, not the tables for oauth or roles. Note that I don't want to turn off the SimpleMembership, only the roles and the oauth support. Question:

SimpleMemberShipProvider, Using multiple PropertyValues with custom Database tables

﹥>﹥吖頭↗ 提交于 2019-12-14 02:18:40
问题 I am creating a Log in scheme using SimpleMembershipProvider in MVC4. I wanted a little more control than what i get with the out of the box AccountControl . So I have modified the connections to use my database and table, however I would like fields like first name, last name and email to be required. WebSecurity.CreateUserAndRole(username, password); fails because of the required field types. I have found that I can use PropertyValues to fix this issue, however I cannot figure out how to

simplemembership MVC4 get username by userId

。_饼干妹妹 提交于 2019-12-14 02:14:24
问题 Someone who works with MVC4 and the SIMPLEMEMBERSHIP knows how can I get a username by the userId? The user is not logged in and I want to delete it, and to delete I have to use Membership.DeleteUser(string username) 回答1: You could use the GetUserNameFromId method of the SimpleMembershipProvider as such: SimpleMembershipProvider provider = new SimpleMembershipProvider(); string name = provider.GetUserNameFromId(id); Ensure you have a reference to WebMatrix.WebData so you can use the

Entity Framework Code First with SimpleMembershipProvider

半腔热情 提交于 2019-12-13 04:59:11
问题 I have two projects inside one solution: foo.Domain (Class Library, my entities and DBContext are in here) foo.WebUI (ASP.NET MVC 4.5, empty template) Inside foo.Domain i create my entities and translate them into actual database using Entity Framework. I've been searching online on how I can create a custom membership feature with register, login functions etc using entity framework code first and built in simplemembershipprovider in ASP.NET MVC 4, but most of the demo online used entity

Simpleroleprovider causing remote transaction inside transactionscope

时光毁灭记忆、已成空白 提交于 2019-12-13 04:24:15
问题 I am in the process of upgrading asp.net membership to the new simplemembership provider in MVC4. This is an Azure/Sql Azure app which runs fine on localhost but fails when deployed. I have code in a transaction as follows: TransactionOptions toptions = new TransactionOptions(); toptions.IsolationLevel = System.Transactions.IsolationLevel.Serializable; using (TransactionScope trans = new TransactionScope(TransactionScopeOption.Required, toptions)) { try { ... do a bunch of database stuff in a

MVC Simple Membership Web Site Administration Tool

ぐ巨炮叔叔 提交于 2019-12-13 00:56:48
问题 I must have missed this somewhere (or slept through the class)... the standard ASP security tool for managing users and roles seems to be absent when using the new simple security version. That is, the original is there and working, just points to traditional ASP security... NOT to the new "simple" system. In my project I can log in, I can look at the webpages_ tables but can find no method of accessing them in my project... I would be happy to manage roles and get the USERID and maybe ROLEID

Simple Membership gives me Unable to find the requested .Net Framework Data Provider

▼魔方 西西 提交于 2019-12-12 18:34:04
问题 I am trying to add ASP.NET Simple Membership to my MVC 5 application. When the application start the initialization part in Global.asax.cs - Application_Start() gives me the following error: Unable to find the requested .Net Framework Data Provider. It may not be installed. I'm initializing the membership by calling WebSecurity.InitializeDatabaseConnection("CareerEntities", "UserProfile", "UserId", "UserName", true); I have following connection string (I'm using Entity framework Database

Get all roles of any user (yes, not currently logged one)

非 Y 不嫁゛ 提交于 2019-12-12 06:35:16
问题 In an MVC app, administrator has a CRUD controller for managing users. Now, the functionality of the edit part needs to be extended and it involves adding a number role dependent tabs. They depend on the role of the viewed user, rather than on roles of the administrator who is viewing them. The easiest way for achieving this, would be getting all roles of that user as a array of strings (or similar), but how do I actually go about obtain those. Is there a preferred method of getting all roles

SimpleMembershipProvider roles not accessible

天涯浪子 提交于 2019-12-12 00:48:29
问题 I have MVC4 application which uses SimpleMEmbershipProvider for authentication mechanism. Everything works fine, apart of when I return to the application and authenticate using persistant cookie. I am authenticated fine, but cannot access roles that I am assigned to. Effectively, cannot access roles at all: string.Join(",", Roles.GetRolesForUser(User.Identity.Name)) returns empty string What might be causing that? 回答1: This can happen when the SimpleMembershipProvider hasn't been initialized

InitializeSimpleMembership filter issue

纵然是瞬间 提交于 2019-12-11 19:46:02
问题 I have MVC 4 application with out of the box Simple Membership mechanism implemented. Recently I have discovered that every single time I call any of the controllers in my application OnActionExecuting method in InitializeSimpleMembershipAttribute filter is executed! Even though I have commented out InitializeSimpleMembership attribute on Account controller like so: [Authorize] //[InitializeSimpleMembership] public class AccountController : Controller { the filter is still getting called!