asp.net-identity

The AspNetUserLogins table Identity [closed]

南楼画角 提交于 2019-12-03 04:26:30
What is the AspNetUserLogins for? Is It to store the logins from the user? How can I then update this table with that data? Preet Singh What is the AspNetUserLogins for? In Asp.net Identity, the Identity system uses the AspNetUserLogins table to hold information about 3rd party/external logins, for example users who login into your site via Google, Facebook, Twitter etc. The AspNetUsers table is the primary table to store user information, this is linked to AspNetUserLogins via UserId -> AspNetUsers.Id . For example if the user logs into your site via Facebook, then the LoginProvider is the

User Lockout in .net 4.5.1 ASP.NET MVC 5

醉酒当歌 提交于 2019-12-03 04:25:29
问题 So in the new .Net Framework 4.5.1 AspNetUser table does not have a column to lock user out after a finite number of unsuccessful attempts. Are there frameworks or solutions built for that purpose to replace the functionality that once existed in previous .net frameworks? Or do I have to build my own? 回答1: In the upcoming 2.0 Identity release, there is support for Account Lockout Configuration: manager.UserLockoutEnabledByDefault = true; // Enables ability to lockout for users when created

Identity Provider and Unity Dependency Injection

有些话、适合烂在心里 提交于 2019-12-03 04:20:21
I have downloaded this sample in which I can try the features of Identity Provider in ASP.NET MVC 5: http://www.nuget.org/packages/Microsoft.AspNet.Identity.Samples I have used many times Unity DI for my repositories, services, unit of work and other stuff without problems. But now, when I install Unity DI, I have many problems with the Interfaces and DI that uses the Identity Provider. I just have downloaded the code of the example and I have configured the Unity DI, but I don't want to use Unity for the Identity Membership, I want to use Unity DI just for me stuff (IRepository, IService,

MVC 5 Identity Automatic Logout

岁酱吖の 提交于 2019-12-03 04:14:34
问题 How do I implement an Automatic Logout Timer. So basically if the user is inactive for x minutes their session is ended? I have tried: <system.web> <sessionState timeout="1"/> </system.web> But it doesn't seem to work. Here is code that is in my startup: public void ConfigureAuth(IAppBuilder app) { // Enable the application to use a cookie to store information for the signed in user app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes

Asp.Net MVC5 How to ensure that a cookie exists?

…衆ロ難τιáo~ 提交于 2019-12-03 03:55:52
I'm new to MVC (5). In order to add localization support to my website I added a " Language " field to my ApplicationUser : IdentityUser What's the best approach to now store this information in the browser and ensure that it gets re-created even if the user manually deletes it? TL; but I've got time What I've tried until now: I started creating a cookie in my method private async Task SignInAsync(ApplicationUser user, bool isPersistent) but I notice that: This method is not used if the user is already authenticated and automatically logs in using the .Aspnet.Applicationcookie and my language

Code First & Identity with Azure Table Storage

☆樱花仙子☆ 提交于 2019-12-03 03:54:56
问题 I'm working on a small web app and I've just hit the point in development where I need to start making database decisions. My original plan was to go EF Code First with MSSQL on Azure because it just simplifies the process of working with a database. However, when investigating my database hosting capabilities on Azure, I discovered Azure Table Storage which opened up the world of NoSQL to me. While the Internet is ablaze with chatter about the features of NoSQL, one of the biggest reason I

Get list of users with assigned roles in asp.net identity 2.0

こ雲淡風輕ζ 提交于 2019-12-03 03:38:09
问题 I have a drop down list box which lists roles. I want to get the list of users having that role. I mean list of users that are in "Administrator" role or "CanEdit" role. Here is my code: public IQueryable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser> GetRolesToUsers([Control] string ddlRole) { //ddlRole returns role Id, based on this Id I want to list users var _db = new ApplicationDbContext(); IQueryable<Microsoft.AspNet.Identity.EntityFramework.IdentityUser> query = _db.Users; if

How override ASP.NET Core Identity's password policy

寵の児 提交于 2019-12-03 03:29:12
问题 By default, ASP.NET Core Identity's password policy require at least one special character, one uppercase letter, one number, ... How can I change this restrictions ? There is nothing about that in the documentation (https://docs.asp.net/en/latest/security/authentication/identity.html) I try to override the Identity's User Manager but I don't see which method manages the password policy. public class ApplicationUserManager : UserManager<ApplicationUser> { public ApplicationUserManager(

How to disable a User in Identity 2.0?

十年热恋 提交于 2019-12-03 03:24:11
I'm trying to find a way to disable a user in Identity 2.0 and can't seem to find any info on it. I would like to basically set a user to IsActive=false and would prefer to do it as soon as the user is created. However, I need a way to set the IsActive for our site Admin. I already have this with ASP.Net membership but I'm looking to covert the site to MVC and Identity. For my requirements we ask people to go ahead and register an account but we want it to be disabled by default. Then when we receive payment for joining we will go back and enable them. We also use it to disable users when

Identity Server 4 + Identity Framework + React front-end

我的梦境 提交于 2019-12-03 03:21:13
I'm looking for advice on how to properly put an environment like this together. There's a ton of info out there and a ton of material to cover in the Quickstarts, but I'm still feeling fairly lost after 3 days of trial-and-error. I'm familiar w/ Identity Framework in the .NET Framework, but have never worked with Identity Server prior to this. We've got a microservices setup built on Node and MySql...a series of services in Docker containers which talk to their own db nodes in a MySql cluster. We have a single management UI built in React & Redux - it will run from an AWS bucket. I've been