asp.net-identity-2

Identity Framework User Lockdown

╄→尐↘猪︶ㄣ 提交于 2020-07-21 03:55:26
问题 I'm trying to lock user login after 3 unsuccessful login attempts for 5 minutes. I have add this 3 lines to App_Start/IdentityConfig.cs public static ApplicationUserManager Create( ... ) method: manager.MaxFailedAccessAttemptsBeforeLockout = 3; manager.DefaultAccountLockoutTimeSpan = new TimeSpan(0, 5, 0); manager.UserLockoutEnabledByDefault = true; After that I register new user via POST /api/Account/Register (in default scaffolded AccountController ). Account is created and LockoutEnabled

Identity Framework User Lockdown

不想你离开。 提交于 2020-07-21 03:54:05
问题 I'm trying to lock user login after 3 unsuccessful login attempts for 5 minutes. I have add this 3 lines to App_Start/IdentityConfig.cs public static ApplicationUserManager Create( ... ) method: manager.MaxFailedAccessAttemptsBeforeLockout = 3; manager.DefaultAccountLockoutTimeSpan = new TimeSpan(0, 5, 0); manager.UserLockoutEnabledByDefault = true; After that I register new user via POST /api/Account/Register (in default scaffolded AccountController ). Account is created and LockoutEnabled

Is it possible to register more than one user with Asp.Net Identity core?

久未见 提交于 2020-06-27 17:25:05
问题 I know by creating an user service with entity framework and creating a password hash i can add one or more users to the website! but i'd like to use asp.net identity features even when i want to register batch users (like upload users list with excel or xml file). In my scenario i want register more than one users on the website by uploading users list in xml,json or excel file. And i want to register all of them in one transaction. Has anyone idea? 回答1: Depends at what level of abstraction

Why asp.net Identity user id is string?

假装没事ソ 提交于 2020-04-29 06:51:46
问题 I want to use System.Guid type as an id for all of my tables in asp.net web api application. But I also use Asp.net Identity, which using a string -type id (to store guids as well). So I wonder why is it using string id instead of System.Guid by default? And what is better choice to use through all the application - Guid id or string -guid id? In case of using string - what is the most proper and reliable way to generate new id - in code or in database? 回答1: With ASP.NET Core, you have a very

How to configure ASP.NET Identity ApplicationUserManager with StructureMap

醉酒当歌 提交于 2020-01-29 04:48:05
问题 I am using asp.net identity in my project and using structuremap as DI framework. the problem is when i use constructor injection then ApplicationUserManager not configured all of it's members e.g TokenProvider, ... this is my ApplicationUserManager class: public class ApplicationUserManager : UserManager<User, long> { public ApplicationUserManager(IUserStore<User, long> store) : base(store) { } public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options

intermittently fail to log in with Asp.net Identity 2

喜你入骨 提交于 2020-01-24 16:47:06
问题 Visual studio 2013, Asp.net Identity 2.1.0 My log in page (generated by vs2013 by default), (1) sometimes I can log in (2) sometimes I fail to login. when fail to login, they staying on login page, but with "?ReturnUrl=..." at the end of url. Open two browser at the time, say one is IE and another is Chrome, then I find Chrome succeed and IE failed. when I log in successfully, I saw this on response header by using Fiddler: Set-Cookie: .AspNet.ApplicationCookie=MlpChRy8gmGaxxIAo9EFbGrWf4J3mm.

Error on installing ASP.NET Identity 2 Samples

走远了吗. 提交于 2020-01-24 03:44:05
问题 I'm trying to install ASP.NET Identity 2 samples project. I open Visual Studio 2013, create an empty ASP.NET project, open Package Manager Console and type: Install-Package Microsoft.AspNet.Identity.Samples -Pre After some time of installing it returns an error: Unable to uninstall 'jQuery 1.10.2' because 'bootstrap 3.0.0' depends on it. Ok, I type the installation command again. This time the error is: Failed to add reference to 'System.Net.Http'. Please make sure that it is in the Global

Understanding Asp.Net Identity key points

ぃ、小莉子 提交于 2020-01-21 08:16:23
问题 I am an Asp.net developer but very much new to the Asp.net Identity framework. I have been studying the sample application and followed some tutorials too on Identity but still I am not able to grasp the concept completely. I have very firm grip over Asp.net membership but Identity seems nothing like membership. I will explain what I have done so far. I am creating a simple application in which I am following code first approach. I have created entity model for User which inherits from

Suppress redirect on API URLs in ASP.NET Core

拥有回忆 提交于 2020-01-20 03:16:14
问题 I have an ASP.NET Core site that uses cookie authentication for most pages. For those pages, the default server response of providing a 302 redirect for an unauthorized client is desirable. However, the site also accepts API requests; they use API keys and have no use for cookies. Ideally, I'd like to turn off cookie processing for the API URLs altogether, but minimally, I need to ensure that if an API client is unauthorized, the server doesn't respond with a 302 redirect. 回答1: Replace the

ASP.NET Core 2.0 - ASP.NET Identity - Invalid Token Error

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-16 18:07:09
问题 I am trying to confirm email from my users and it always works locally on development environment but it always fails in hosted server. I cannot RDP to this server and this is third-party server where I have subscribed. It gives "Invalid Token" error everytime. Nothing else. Is there any workaround for this ? Please advise. Thanks Adam This is how the code is generated and encoded. var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); var newcode = HttpUtility.UrlEncode