membership-provider

ASP.NET user database without web.config connection strings

爷,独闯天下 提交于 2019-12-11 06:27:52
问题 I'm wondering whether it's possible to use built in ASP.NET application services (aspnet_user, aspnet_role etc table) without specifying a connection string in a web.config. At the moment I store connection strings externally, but I keep finding hard-coded connection strings all over the web.config xml, various providers etc. It's driving me crazy. Thank you 回答1: You can write your own provider via overriding already existed, built-in class so it will read it's connection string from

Overriding ValidateUser() with SqlMembershipProvider and custom SQL database

烂漫一生 提交于 2019-12-11 06:26:48
问题 I wish to use an SQL database that it already in use on my network, so I have written code to override ValidateUser() : public override bool ValidateUser(string username, string password) { return true; } I've set this so that it returns true, without checking my database for now, just to test the theory of it. Is that all I need to do, or is there more to do so that it works properly with the other functions, like storing the username information so that it can be retrieved later on, or do I

Custom Membership Provider won't redirect

拥有回忆 提交于 2019-12-11 05:08:55
问题 I have setup a custom membership and role provider that is not currently working as it should. I suspect that I have missed something but with all my research I have not been able to work out what it is. The problem that is occurring is that when I enter the correct login details the login page reloads rather than redirecting. I suspect that it is redirecting but for some reason it doesn't recall that the authorisation has been approved, so as a result it sends the user back to the login page

MVC3 getting an Id from another table when I have the Membership.GetUser().ProviderUserKey

旧巷老猫 提交于 2019-12-11 04:05:25
问题 I'm relatively new to the MVC world, and am developing an MVC3, C# .Net, EF4 application that uses the default Microsoft membership provider. There are requirements to have some additional fields appended to the membership provider tables, which help make up an extended profile for each user. (The table that holds this data is called Profile, and it has a PK of ProfileId INT and also holds an FK of the UserId from aspnet_Users/aspnet_Membership.) I want to offer new users the chance to

Why do I only have a subset of asp.net membership tables?

﹥>﹥吖頭↗ 提交于 2019-12-11 01:35:48
问题 Summary: I am trying to use asp.net membership, roles, and profiles, but am having trouble getting my code to use the tables generated by aspnet_regsql.exe. What I tried: Ran aspnet_regsql.exe on my database. This worked and all the tables were created. Called Membership.CreateUser("tester7","tester7","tester7@hi.com"); This then created the following tables and stored the user in dbo.Memberships instead of dbo.aspnet_Memberships. dbo.Applications dbo.Memberships dbo.Profiles dbo.Roles dbo

Manage user access to pages in ASP.NET

[亡魂溺海] 提交于 2019-12-10 20:18:35
问题 I am using MembershipProvider and currently a have 3 roles: User, Super User, Admin. Also I have pages that can be seen only by Admin and Super User. For these pages a I use configuration in web config: <location path="Users.aspx"> <system.web> <authorization> <allow roles="Admin, Super User"/> <deny users="*" /> </authorization> </system.web> </location> And this works perfectly fine. But I have bunch of pages Evaluations Actions Reports Files to which a I want separate access. I want grant

user logged out frequently (Default Membership provider)

蓝咒 提交于 2019-12-10 14:07:56
问题 I have asp.net mvc 3 site deployed on shared hosting. My problem is that my site frequently logged out user automatically after 5 to 10 min. Although i have set the time to 200 min in web.config and application_start as shown below <forms loginUrl="~/Account.mvc/index" slidingExpiration="true" timeout="200" protection="All" /> HttpCookie authCookie = FormsAuthentication.GetAuthCookie(userName, rememberMe); FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);

Using ASP.NET Membership Provider with an existing user database

流过昼夜 提交于 2019-12-10 13:59:09
问题 I'm currently re-writting an entire website in .Net. The current website is written in foxpro and uses custom logic, validation rules, and Sql server tables to store and authenticate users. I want to use Membership Provider but I have one major problem that I'm not sure how to overcome. Both, the new site and the old site have to share users and credentials. The users will have to be able to use both sites during the transition phase without having to update their profiles separately. What is

ASP.NET MVC membership - user being logged out frequently - don't know why

大城市里の小女人 提交于 2019-12-10 13:06:26
问题 I have an ASP.NET MVC 4 web application. Running locally, it works fine, but on the web host (which uses shared hosting), the logged on user is frequently logged out by being redirected back to the home page. In most cases, the user is logged out after performing only a few actions. The web host suggested that my application could be using up too much memory but I used a program to profile the memory usage and I confirmed that it wasn't using excessive amounts of memory - in fact the

asp.net mvc and custom membership and role providers

两盒软妹~` 提交于 2019-12-10 12:57:27
问题 My question, is it possible to build customer membership and role providers (overriding the asp.net providers) when using asp.net mvc? I am guessing it is possible but have not seen any information about it. Would it be done the same way as in asp.net? Just changing the web.config to point to a new provider and then providing the override methods? I have found many articles discussing changing the data source of the membership and role providers but I don't like the tables that asp.net uses