asp.net-identity

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

Use Azure AD only for Authentication and not Authorization

非 Y 不嫁゛ 提交于 2020-07-07 06:32:57
问题 I've been messing with this for a few days now... What I would like to do is Authenticate users with Azure AD, and when successful, automatically log them in using ASP.NET Identity for authorization. If they do not have an account I would like to create one automatically. Essentially Azure AD is just confirming that they are a part of the organization, the ASP.NET Identity portion is it's own database where I can use the [Authorize] attribute to set up custom roles OUTSIDE of Azure AD. This

Decoupling ASP.NET Identity from the Core Domain Models - Onion Architecture

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-04 06:29:11
问题 I am using this sample project (https://github.com/imranbaloch/ASPNETIdentityWithOnion) as my application architecture, in this sample the core is completly decoplied from the infrastrure including the identity framework. In this sample the author has used the adapter pattern to decouple core identity classes (IdentityUser, IdentityRole ... ) and provide classes like them in the Core layer. Now the issue in this sample project is that the Domain model (Product, Images) are not linked with the

ASP.NET_SessionId not found in OWIN OpenIdConnectAuthentication

只愿长相守 提交于 2020-06-29 03:37:13
问题 BackGround : User once logged in to the our Web Application (using App level credential) will be presented with with Mail System they want to use based on that user will be redirected to respective authorization server to authenticate (using login / password of their mail system) and the auth server will return an access token back. In Notification events like OnAuthorizationCodeReceivedAsync or OnAuthenticationFailedAsync; we are not getting ASP.NET_SessionId so having said that i am not

Seed Roles (RoleManager vs RoleStore)

自古美人都是妖i 提交于 2020-06-28 06:46:08
问题 Through looking at the posts here, I've seen two different ways of creating ASP.NET Identity roles through Entity Framework seeding. One way uses RoleManager and the other uses RoleStore . I was wondering if there is a difference between the two. As using the latter will avoid one less initialization string[] roles = { "Admin", "Moderator", "User" }; // Create Role through RoleManager var roleStore = new RoleStore<IdentityRole>(context); var manager = new RoleManager<IdentityRole>(roleStore);

Why does Blazor.net Server, Visual Studio 2019 set up AAD B2C to use OAuth implicit flow but recommends against it?

三世轮回 提交于 2020-06-28 04:09:11
问题 I set up a new Blazor.NET project in Visual Studio 2019 (preview 5) and add Azure AD B2C (AADB2C) and deploy it to an Azure Docker AppService. If I don't enable OAuth2 implicit flow in AADB2C, then I get the following error using an AADB2C V2 Sign-In-Flow: error=unauthorized_client&error_description=AADB2C90057%3A+The+provided+application+is+not+configured+to+allow+the+%27OAuth%27+Implicit+flow. However, the AADB2C site advises against using this flow unless required for serverless SPA. It

Registering multiple users using same form .net identity

泄露秘密 提交于 2020-06-27 16:18:27
问题 I have a dynamic in line form in my ASP.NET MVC application, which when a user clicks a button, in this case 'add', it will add a new row to the form with the required fields. I am trying to get this to work with ASP.Net Identity, but not having any luck. I believe it would be similar to having a list, and then doing a for a loop through the list to register the users, but putting it into practice is proving to be confusing. <input name="__RequestVerificationToken" type="hidden" value="">

Losing user cookies and session data after being redirected from payment gateway

寵の児 提交于 2020-06-26 03:58:40
问题 I am using ASP.net MVC5 for my e-commerce project . I am not using any SSL . I have also successfully integrated the payment gateway. The problem i am facing is that while i am posting data to the payment gateway it process the payment and send backs the response to our web application action method the user gets logged out i.e. User.idenity sets back to null . I think it occurs beacuse of HTTP to HTTPS connection as every gateway uses https as a security. and after getting redirected to

Losing user cookies and session data after being redirected from payment gateway

为君一笑 提交于 2020-06-26 03:58:33
问题 I am using ASP.net MVC5 for my e-commerce project . I am not using any SSL . I have also successfully integrated the payment gateway. The problem i am facing is that while i am posting data to the payment gateway it process the payment and send backs the response to our web application action method the user gets logged out i.e. User.idenity sets back to null . I think it occurs beacuse of HTTP to HTTPS connection as every gateway uses https as a security. and after getting redirected to