membership-provider

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

How to add retry logic to ASP.NET Membership Provider for Azure SQL?

萝らか妹 提交于 2019-12-04 11:24:57
We have a database of ASP.net sqlMembershipProvider based users on an Azure SQL database. It has become apparent that the out of the box sqlMembershipProvider 4.0 does not have the required retry logic for Azure SQL connections which can drop out due to throttling or can expire. It is possible to implement our own membership provider that has this functionality but it would have to be exactly the same database interactions as the standard sqlMembershipProvider 4.0 in order to work with the existing users in our database. However for that it would require looking into the source of the original

attribute for .net MVC controller action method

瘦欲@ 提交于 2019-12-04 03:50:10
Essentially I want to show a friendly message when someone is not part of a role listed in my attribute. Currently my application just spits the user back to the log in screen. I've read a few posts that talk about creating a custom attribute that just extends [AuthorizeAttribute], but I'm thinking there's got to be something out of the box to do this? can someone please point me in the right direction of where I need to look to not have it send the user to the log in form, but rather just shoot them a "not authorized" message? If simplicity or total control of the logic is what you want you

code first membership provider

你离开我真会死。 提交于 2019-12-03 22:01:39
How can I integrate EF 5.0 with membership provider using code first? I have my own database schema which I want to use for registration of users etc. You should take a look at the SimpleMembershipProvider It is very easy to use it together with EF. Update For MVC4 I would start with the blank template. you need WebSecurity.InitializeDatabaseConnection to set up the database. WebSecurity.InitializeDatabaseConnection("DefaultConnection", "Users", "Id", "UserName", true); It takes as parameters a name of a connectionstring, the table, a unique identifier column and the username-column. The model

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?

Sample Code for Creating Custom Membership Provider

北战南征 提交于 2019-12-03 19:38:51
问题 I am writing an MVC 3 application and I am trying to implement my own custom membership provider (following the sample in Apress' Pro ASP.NET MVC 3 Framework). I created my custom class, inherited from MembershipProvider and (using ReSharper) implemented all 27 of the methods with NotImplementedExceptions. Now, I have overridden the ValidateUser method as the book states and it works fine, but I would like to make my provider more robust and implement the other methods (e.g. set

Default Role Provider could not be found on IIS 7 running .NET 4

一笑奈何 提交于 2019-12-03 16:18:06
Good morning all, I am attempting to implement my custom membership and role providers in my web application that I have implemented under the Default Web Site in my instance of IIS 7. My web application is running under a .NET 4 application pool. However, after setting up the corresponding web.config, I get the following error: Parser Error Message: Default Role Provider could not be found. I have included the following block of code in the system.web section of the corresponding web application's web.config: <membership defaultProvider="CustomMembershipProvider" userIsOnlineTimeWindow="20">

ASP.NET Membership.ValidateUser() always return “false” [duplicate]

烂漫一生 提交于 2019-12-03 15:48:11
This question already has an answer here: Membership.ValidateUser always return false on IIS 2 answers Here is my web.config: <membership defaultProvider="CustomizedMembershipProvider"> <providers> <clear /> <add name="CustomizedMembershipProvider" connectionStringName="MYbdName" applicationName="/" type="System.Web.Security.SqlMembershipProvider" requiresQuestionAndAnswer="false" passwordFormat="Clear" enablePasswordRetrieval="true" requiresUniqueEmail="true" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0" /> </providers> </membership> I even hardcoded the username and

Ninject per session singleton?

倖福魔咒の 提交于 2019-12-03 13:44:28
问题 So I'm trying to introduce the concept of a user to my application and have got my own set of custom login routines etc. working fine. In my module, I'm binding my IUserSession to my implementation and InSingletonScope. Now I suspect this was the case and have been able to prove that this is not the right thing to do, if I try and login with two users against the same site, I get only one set of data. If I implement a MembershipProvider, do I avoid such a restriction. I know that if I

SQL to create .Net Membership Provider users

a 夏天 提交于 2019-12-03 13:38:47
问题 I have a SQL script that creates users in in my database. It uses the .Net membership stored procs. At this point it works fine. The only issue is that the passwords are saved clear text. What should I change here to they are salted/encrypted (Not sure what term to use here) GO DECLARE @return_value int, @UserId uniqueidentifier EXEC @return_value = [dbo].[aspnet_Membership_CreateUser] @ApplicationName = N'Theater', @UserName = N'sam.sosa', @Password = N'mypassword', @PasswordSalt = N