membership

Locking out a user in an ASP .Net Custom Membership Provider

我的梦境 提交于 2019-12-04 12:07:26
问题 I've had to create a custom membership provider for my current ASP .Net project in order to fit in with our database schema, and am having problems configuring it to lockout a user if they get their password wrong three times, as is supported by the standard providers. Is this something I need to implement myself, or should it be supported inherently? I have no code that specifically deals with it (and none of the interface members seem to deal with it specifically), but if I need to

Why can't anonymous unions contain members with non-trivial constructors/destructors?

北战南征 提交于 2019-12-04 07:26:46
I may be mistaken, but the basic explanation I've found has been that the union can't initialize because it doesn't know which member's constructor to call. The compiler can not automatically generate a constructor for the union. Why is the user not allowed to define the unions constructor? This would remove said issue and allow the presence of union members that have a non-trivial constructor/destructor. Also, why can't a union member have any custom constructors? The previous explanation doesn't stand for custom constructors. Update 1: Example: struct SQuaternion { union { S3DVector Axis;

How should I manage membership in my ASP.NET MVC 4 app?

匆匆过客 提交于 2019-12-04 06:28:31
As I'm in the process of creating my first ASP.NET MVC 4 Internet application, I'm wondering how to best manage membership on the site. The app allows users to register and log on. I'm interested in finding out how to implement a complete solution for managing site membership, including an administrative user interface. How should I go about adding membership administration facilities to my app? I'm primarily considering two different NuGet packages to base my solution on, SecurityGuard.MVC4 and MvcMembership . Both look like a good starting point for adding membership administration to my app

ASP.NET Forms Authentication With Only UserName

妖精的绣舞 提交于 2019-12-03 21:54:28
I have a bit of a hybrid situation on my hands. I'm writing an intranet asp.net web app. I don't want to use full blown Windows Authentication, because I don't have proper groups set up in Active Directory to be able to authenticate users simply based on what group they are in. Up until now, I had created a membership database, and was manually authenticating users based on their NT Login. The app is getting more complex, and I'm looking at using the Membership and Roles providers to authenticate users. Here's my issue: I want to be able to authenticate users just based on their NT, but I don

Extend Membership API, MembershipUser

戏子无情 提交于 2019-12-03 20:54:13
I created my own database schema to store user information. CREATE TABLE [dbo].[MyCustomMembership_Users]( [UserId] [uniqueidentifier] NOT NULL, [UserName] [nvarchar](256) NOT NULL, [LoweredUserName] [nvarchar](256) NOT NULL, [MobileAlias] [nvarchar](16) NULL, [IsAnonymous] [bit] NOT NULL, [LastActivityDate] [datetime] NOT NULL, [FirstName] [nvarchar](256) NULL, [MiddleName] [nvarchar](256) NULL, [LastName] [nvarchar](256) NULL) Then I extend the MembershipProvider and MembershipUser and create the overriden methods. How can I pass the additional information when I call the CreateUser Method?

Use ASP.NET Membership in ServiceStack

≯℡__Kan透↙ 提交于 2019-12-03 15:15:11
how can i use asp.net membership in ServiceStack ? (ServiceStack.OrmLite , ServiceStack.Host.AspNet , etc ) mythz You can host ServiceStack on a custom path , i.e. at /api which lets you run ASP.NET web forms and ServiceStack side-by-side and then use the normal ASP.NET membership provider in ASP.NET. You can then share UserSessions with ServiceStack using its Session Provider, here's an example on how to instantiate a Session with MVC - you can use this same class with ASP.NET. The alternative is to forgo the ASP.NET membership provider and just stick to the built-in authentication in

what is the best way to make some pages in asp.net require login?

安稳与你 提交于 2019-12-03 14:46:43
I am working with asp.net website project that some of pages need authentication. I am using asp.net membership. I read some answers. e.g. make all of those pages in folder and create inner web.config that describe the privilege. This is one way solve the problem but I need way that is more fixable and effective. If you don't want to hard code this in web.config(s) you will need to implement a "Base Page" type control. Your base page class should inherit from System.Web.UI.Page, and would need to have a method you could call to say "User must be logged in" or "User must be in role x", and if

MembershipUser.IsOnline is true even after logout

♀尐吖头ヾ 提交于 2019-12-03 11:52:28
I'm currently creating a website using Visual Studio 2010. I'm using the default membership schema in SQL Server 2008 for user authentication. Now I'm facing the following problem. When a user logs out, the membership.IsOnline property of that user should be set to false. However that it is not happening; membership.IsOnline property of that user is still true. I'm using the LoginStatus control to provide a logout link to the user. I have tried to follow User.IsOnline = true even after FormsAuthentication.SignOut() . But results nothing. AFAIK, FormsAuthentication.SignOut doesn't have a direct

Change username in MVC 5

人走茶凉 提交于 2019-12-03 07:49:38
I am using ASP.NET MVC5 and Identity 2.0 (beta). It is possible for users to change the username? I am trying using UserManager.UpdateAsync method throws an exception. Regrads, Fran. Yes it is possible using the UpdateAsync method but you need to ensure that you update both the email and username fields. var user = userManager.FindById(userId); user.Email = email; user.UserName = email; var updateResult = await userManager.UpdateAsync(user); This method works successfully for me This works for me: public async Task<ActionResult> ChangeUsername(string value) { if (UserManager.Users.Where(x => x

ASP.NET Identity

旧时模样 提交于 2019-12-03 06:57:44
问题 I'm currently building a new ASP.NET MVC 5 project which I want to release around September. I need to choose a membership system, but I'm currently quite confused about which direction should I take. The current SimpleMembership works well, but will apparently be incompatible with the upcoming ASP.NET Identity. ASP.NET Identity on the other hand is absolutely new with zero documentation and can change anytime. Finally it seems that string based IDs are used here, which seems like a very