asp.net-membership

ASP.Net Membership: Roles saved on Different Database

纵饮孤独 提交于 2019-12-11 07:48:15
问题 I'm learning about how to manipulate the Membership class. I have added the Membership database to my website's SQL Database using aspnet_regsql.exe and so far I can list and add users without a problem. However, I decided to add some roles using the ASP.Net Configuration Tool. The roles were added, but did not show up in the aspnet_Roles table of my SQL database. I have since noticed ASPNETDB.MDF in my VS2010 App_Data folder for the website in question and the Roles are appearing in there.

Sitecore switches user session with another user

*爱你&永不变心* 提交于 2019-12-11 06:56:47
问题 I have an FBA site that uses Sitecore. Every so often, it will confuse one user with another. What I mean is, somehow User A will unintentionally hijack User B's session. User A will be looking at a page that a) they don't have permission to view, and that's b) customized for User B. The one time I was able to reproduce (accidentally) , I got my original session back after I clicked through to another page. I know Sitecore leverages the Aspnet membership DB, so this might be an issue with

ASP.NET Membership Provider: Defining a foreign key to aspnet_Users.UserName

无人久伴 提交于 2019-12-11 06:49:33
问题 I'd like to setup a foreign key to a default membership table but I'm getting an error when trying to define it. I'm using the default aspnet_Users table and also my own Posts table. I'm trying to setup the tables as follows: aspnet_Users UserId (PK) uniqueidentifier UserName nvarchar(256) Posts PostID (PK) int UserName (FK -> aspnet_Users.UserName) nvarchar(256) However, when I try to set this up using the VS 2010 designer, it gives me the following error: The columns in table 'aspnet_Users'

Storing and accessing a legacy UserID in asp.net membership

吃可爱长大的小学妹 提交于 2019-12-11 06:42:15
问题 I have a legacy UserID (int32) which I wish to link to asp.net membership. I have set up link tables on the database and I'm happy with that part. The question is where to store the UserID in the web application so that it is easily accessible when required. I decided that the best place to store it is in the UserData part of the FormsAuthenticationTicket in the LoggedIn event of the Login Control. My first attempt to make this accessible was to extract it in the PreInit of my BasePage class.

Custom Membership/Role/Profile Providers WITHOUT inheriting the MembershipProvider, RoleProvider, etc.?

梦想与她 提交于 2019-12-11 04:02:57
问题 Is there anything holding me back from just doing the whole membership, roles, and profiles custom, without inheriting from the abstract classes like MembershipProvider, etc.? MSDN clearly states: "When implementing a custom role provider, you are required to inherit the RoleProvider abstract class." (http://msdn.microsoft.com/en-us/library/system.web.security.roleprovider.aspx) However, as I'm going along here, I'm finding that I'm really customizing the whole thing to our specific needs,

How do I define the password rules for the ASP.NET Membership Provider?

陌路散爱 提交于 2019-12-11 03:32:03
问题 When using web forms authentication with the ASP.NET Membership provider, we are defaulted to some decently strict password rules. I think eight characters, including one non-alpha, are required. I'm not looking to make them all willy-nill loose, but generally I do not use a non-alpha character in my own password, and feel like a hypocrite forcing my users to do so. I've done some looking, but can't figure out where this rule is defined. I'm sure I'm just missing something simple - anyone

IsAuthenticated is false! weird behaviour + review question

让人想犯罪 __ 提交于 2019-12-11 03:29:59
问题 This is the login function (after I validate user name and password, I load user data into "user" variable and call Login function: public static void Login(IUser user) { HttpResponse Response = HttpContext.Current.Response; HttpRequest Request = HttpContext.Current.Request; FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, user.UserId.ToString(), DateTime.Now, DateTime.Now.AddHours(12), false, UserResolver.Serialize(user)); HttpCookie cookie = new HttpCookie

Server-side validation for CreateUserWizard

China☆狼群 提交于 2019-12-11 03:17:06
问题 I am using the built-in asp.net membership framework. I created a registration page and set up client-side validation with some custom validators, validating through jQuery AJAX to a web service and the client-side validation works ok. I have two issues: Even when the client-side validation fails, the continue button still works. How do I disable it? I don't want to count on client-side validation. How do I go about implementing server-side validation in the CreateUserWizard? Can you point me

Forms Authentication works on dev server but not production server (same SQL db)

佐手、 提交于 2019-12-11 02:56:05
问题 I've never had this problem before, I'm at a total loss. I have a SQL Server 2008 database with ASP.NET Forms Authentication, profiles and roles created and is functional on the development workstation. I can login using the created users without problem. I back up the database on the development computer and restore it on the production server. I xcopy the DLLs and ASP.NET files to the server. I make the necessary changes in the web.config, changing the SQL connection strings to point to the

SetAuthCookie does not set cookie on our test server

China☆狼群 提交于 2019-12-11 02:33:36
问题 I am trying to setup my website on a new environment, and I have a problem with the membership provider. I can call Membership.ValidateUser , which returns true and false, as it should. That is perfect. However, on my new environment, the cookie is never set. I can see on localhost and our production server, that it sets a cookie called CommunityServer , but not on our new environment. Web.config code : <authentication mode="Forms"> <!-- development --> <forms name=".CommunityServer"