asp.net-membership

ASP.NET MVC Membership Roles

倖福魔咒の 提交于 2019-12-07 23:14:18
问题 I need some clarifications for ASP.NET Membership; please help me with it. I am using ASP.NET MCV 3 framework and intending to use ASP.NET Membership for users & authentication management using either LDAP or SQL. For what I've understood until now; ASP.NET Membership is: [User] has [Role] or [Role] has [Users] But in my project I have a more complex business logic; where I need this hierarchy to next level like [User] has [Role] -> has [Tasks] So I can dynamically assign/revoke tasks

Custom roles in ASP.NET

五迷三道 提交于 2019-12-07 23:00:08
问题 I am working on an ASP.NET website which uses forms authentication with a custom authentication mechanism (which sets e.Authenticated programmatically on protected void Login_Authenticate(object sender, AuthenticateEventArgs e) ). I have an ASP.NET sitemap. Some elements must be displayed only to logged in users. Others must be displayed only to one, unique user (ie. administrator, identified by a user name which will never change). What I want to avoid: Set a custom role provider: too much

ASP.NET MVC : Using the same database for Entity Framework and ASP.NET Membership

人走茶凉 提交于 2019-12-07 20:14:26
Im trying to user ASP.NET MVC3 with Entity Framework and ASP.NET Membership for authentication. I've set up an existing database as my application services database for membership. When i create the entity data model through the wizard it adds the following connection string to my web.config. <add name="DBEntities" connectionString="metadata=res://*/Models.DB.csdl|res://*/Models.DB.ssdl|res://*/Models.DB.msl;provider=System.Data.SqlClient;provider connection string="Data Source=PM\SQLEXPRESS;Initial Catalog=DB;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data

How can I reference my own table with the MVC Controller.User property?

左心房为你撑大大i 提交于 2019-12-07 18:59:41
问题 With the default membership provider for MVC 2 projects, I can reference User.Identity.UserName as per whatever it creates by default. I don't want to do this--want to use my own tables. So, I implemented the System.Web.Security.MembershipProvider class. The only thing I've implemented, as per many posts on the web and SO, is ValidateUser(string username, string password) I can easily see this accepts username and password strings, I access my database context (LINQ to Entities, actually the

Using ASP.NET 4.0 membership provider with Azure Mobile Services

流过昼夜 提交于 2019-12-07 16:55:49
问题 Ive come up against a major problem. I am building a system which emloys a ASP.NET 4 Web App > Azure SQL > Azure Mobile Service > Windows Phone 8 app. The data is inputed into the Web Site which is already hosted on azure and which employs the Membership Provider and hence its default tables. This data is stored already successfully on Azure SQL db. My major obstacle is Azure Mobile Services requires each and every table on it to have their primary key to be called "id" - lower case! Crazy in

In ASP.NET Membership, why would resetPassword cause a “Specified Method not supported” error?

ε祈祈猫儿з 提交于 2019-12-07 16:27:12
问题 using System.Web.Security; I'm creating a resetPassword form in MVC4: using System.Web.Security; [HttpPost] [AllowAnonymous] public ActionResult ResetPassword(ResetPasswordModel model) { MembershipUser u = Membership.GetUser(model.Username); if (HashResetParams(u.UserName, u.ProviderUserKey.ToString()) == model.Key) { string resetCode = u.ResetPassword(); u.ChangePassword(resetCode, model.Password); } return View("ChangePasswordSuccess"); } Any idea why I'm getting a "ResetPassword- Specified

What encryption does MVC4 use?

Deadly 提交于 2019-12-07 15:31:15
问题 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 回答1: 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

Best database design approach to join complex data to ASP.Net Membership tables

谁说我不能喝 提交于 2019-12-07 13:41:29
I'm looking to use a slightly modified ASP.Net Membership Provider to handle the standard user account creation/authentication/etc in a website. We have a fair amount of legacy data that I need to migrate in order to provide continuity with our existing users' saved information (like order history, wishlist, etc). [NOTE: We have to migrate anyway, so this is not the reason we're migrating data] I'm wondering what a sensible approach is for joining this additional data to the asp.net membership tables. There are a two unique keys that I could use on the user table - UserId or email - which we

Using MySql MySQLMembershipProvider - autogenerateschema=“true” not working?

本秂侑毒 提交于 2019-12-07 13:35:40
问题 I'm trying to use the MySQLRoleProvider(MySql.Web, Version=6.2.2.0) with Visual Web Developer 2008. When trying to add a role I get an exception "Table 'test.my_aspnet_applications' doesn't exist" if (!Roles.RoleExists("TestRole")) { Roles.CreateRole("TestRole"); } Can someone tell me where I went wrong. Or tell me how to generate / find the correct database script to create the role, membership, profile ... MySql tables. <membership defaultProvider="MySQLMembershipProvider"> <providers>

saving the login name as current user identity in asp.net

不羁岁月 提交于 2019-12-07 08:43:22
So I'm making a asp.net login. I want the login name that people use to match an id in my SQL database. So that I can retrieve their information. But currently when I use the code below, from which I get the name of the computer I am currently on. However I would like the user Identity to be what they write in the username textbox at the login screen. If HttpContext.Current.User.Identity.IsAuthenticated Then Dim userName As String = HttpContext.Current.User.Identity.Name Response.Write(userName) End If So I looked for it on net and I think it might have something to do with my web.config file.