asp.net-identity

How override ASP.NET Core Identity's password policy

两盒软妹~` 提交于 2019-12-02 17:00:26
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( DbContextOptions<SecurityDbContext> options, IServiceProvider services, IHttpContextAccessor

ASP.NET Identity + Windows Authentication (Mix mode - Forms + Windows)

限于喜欢 提交于 2019-12-02 16:34:45
I have tried my best to search the web before asking this question. I've seen similar questions on stackoverflow, however, none has been answered satisfactorily for a long time now. This is one more attempt to get this recurring question answered. The Problem How to build an ASP.NET MVC 5 website which uses "Windows Auth" for Intranet users and "Forms Auth" for Internet users? We'd like to accomplish this using ASP.NET Identity. Moreover, we don't want to use Active Directory Groups for authorization. For Intranet users, we want to authenticate them using Active Directory and then fall back to

Custom Membership with Microsoft.AspNet.Identity - CreateLocalUser fails

北城余情 提交于 2019-12-02 15:37:41
I've been trying to implement a custom version of the new Identity features in ASP.NET 4.5 (Microsoft.AspNet.Identity), using Visual Studio 2013. After many hours of playing around with this, I've simplified my code in an effort to get it running without errors. I've listed my code below. When doing a Local Registration, the database tables are created, but the CreateLocalUser method fails. I'm hoping that someone can help me identify the changes needed. Models/MembershipModel.cs using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System; using System

SignInManager,what it is and how,when to use?

邮差的信 提交于 2019-12-02 14:06:36
I am exploring SignInManager class. But the information given on MSDN is very useless. It only tells what are the methods and properties provided. What I am looking for is, 1) What is SignInManager? 2) How to use it? 3) And I have my own database that contains credentials related info(username and passwords) How can I use SignInmanager and how to use it so my custom database is used for authenticating users? I am using asp.net MVC 5 and Visual Studio 2015. In my sample project I have accounts controller that contains action methods like public async Task<ActionResult> ExternalLoginCallback

Save additional profile data during “Register” in ASP.Net Identity (MVC)

拈花ヽ惹草 提交于 2019-12-02 13:23:37
I need to store additional information during user registration such as: First Name, Last Name and etc. My question has two parts: How can I save my additional information during Register? My current method throws error: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details . I have already checked "Watch" inside VS and also used try-catch but it didn't help. Thanks in advance for your help! IdentityModels.cs public class ApplicationIdentityAccount : IdentityUser { public virtual ICollection<AccountProfile> AccountProfiles { get; set; } } public

Connecting local users database with Identity Server 4

故事扮演 提交于 2019-12-02 12:09:44
-> I want to use Identity server 4 as a central token generator for some clients. -> Here my problem is I have implemented Identity server 4 with the help of docs, in the docs the IS4 is using its own database for users to login. -> Can someone explain the way to connect to my own users database for login and token generation. (I'm using the latest version of IS4 and .net core). Thanks in advance :) Note: I have tried all the things from docs -> http://docs.identityserver.io/en/latest/quickstarts/8_aspnet_identity.html The AccountController is a starting point for you to adapt to suit your own

Register with username using identity 2.1

无人久伴 提交于 2019-12-02 12:02:26
New .net identity system uses email and password as registration pair. I would like to change it as it was before and use username for loging users to my webapp. Also I'd like to keep somme additional information during registration as email, phone number. Can You help me and point where I should look for information for solving the problem. I cant find usefull information. Actually the old identity framework system (v 1.0) registration UI different to the new version. You can easily understand what exactly happening in the registration code. New out of the box registration code is: [HttpPost]

Could not load type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider

感情迁移 提交于 2019-12-02 11:39:20
问题 I recently tried to implement authentication using asp.net identity with 4.6.1 framework. After installing all the required packages I am getting the following error when running the application. "Could not load type 'Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ITypeRegistrationsProvider" The same application works fine when all the packages related to identity are uninstalled. Full stack trace is as follows [TypeLoadException: Could not load type 'Microsoft

ASP.NET Identity 2 - UserManager.ConfirmEmail Fails In Production

大城市里の小女人 提交于 2019-12-02 11:09:48
I've set up OWIN in an ASP.NET MVC app (including email confirmation). When an account is created I get an email containing a link to confirm my email. When I visit the link, I get the "Invalid Token" error. If I take that exact same link and instead change the domain to point at localhost while debugging the project, the email confirms just fine. The project is being deployed to an Azure Web Site (which I can't remote debug). I've tossed in some code to email me when confirmation fails (so that I can see the userId and code it was trying to confirm with) and I've verified that the code it's

Changing password asp.net identity

与世无争的帅哥 提交于 2019-12-02 10:43:18
问题 Is there a quick way to verify is user exists and based on existence of user name get user id? (i.e. the user only has the user name and the adds it to change their password)? I would think something like this... String userId = User.Identity.GetUserId(userName); I am looking for a quick way for local users to change their password if need be. 回答1: User.Identity.GetUserId() will return the id of current logged in user. From UserManager you can get any user from their username like this var