asp.net-identity

How to set password rules for ASP.NET identity?

喜欢而已 提交于 2020-01-09 13:07:06
问题 In my ASP.NET applications I have following settings in DefaultMembershipProvider and SqlMembershipProvider in web.config: enablePasswordRetrieval="true" passwordFormat="Clear" requiresQuestionAndAnswer="false" They are required for Digest authentication. I would like to move to ASP.NET Identity. I am using automated tool to update all web.config files that I manage. How do I set these settings for ASP.NET Identity in the project generated by Visual Studio 2013? 回答1: You need to provide

ASP.NET Identity in Microservice Architecture

浪尽此生 提交于 2020-01-09 03:21:45
问题 I'm attempting to implement a web app using a microservice architecture by breaking up major components into separate web servers. I'm implementing an authentication server using ASP.NET Identity (email/username logins only, no Facebook, etc) and a "main" application server. My current challenge is figuring out how the application server will recognize if a user has logged via the authentication server. Since the authentication server generates tokens which it users to verify users's

Will Identity fail if I assign roles and every time I use User.Identity.GetUserId()?

喜夏-厌秋 提交于 2020-01-07 07:37:06
问题 I want to create web portal, where there will be multiple users of 3-4 types. So I have created roles in Startup.cs Like public void Configuration(IAppBuilder app) { ConfigureAuth(app); createRolesandUsers(); } // In this method we will create default User & roles private void createRolesandUsers() { ApplicationDbContext context = new ApplicationDbContext(); var roleManager = new RoleManager<IdentityRole>(new RoleStore<IdentityRole>(context)); var UserManager = new UserManager<ApplicationUser

Custom Verification Code/Token in Asp .Net Identity

∥☆過路亽.° 提交于 2020-01-07 02:44:11
问题 I need to create short code (6 digits) for Email Confirmation using Asp.Net Identity. Currently, if I use "GenerateEmailConfirmationTokenAsync" it provides me with very long code instead of this I want to generate a code which is only 6 digit in length. Is there any way to achieve this how can I extend identity to provide such a feature. any leads towards this will be helpful. Thanks 回答1: Yes you can. Check this SO answer for details. Basically you have to create a class inheriting

MVC 5 Web API Login without Bearer Token

淺唱寂寞╮ 提交于 2020-01-07 02:24:27
问题 Long story short. I have a login form in the header on every single page, when I log in successfully it works fine but when the user is incorrect for example it redirects to the default login page (a view that was originally created with MVC project) with the model errors. I don't want to do that, I want to show errors next to the login form without redirecting. So I decided to implement a login via WEB API - i.e. it does $.ajax jQuery request to the Login API Controller, tries to log user in

Error trying to update to using SignInManager in Identity 2.0

℡╲_俬逩灬. 提交于 2020-01-06 21:28:05
问题 I am trying to update my login feature to using this line: var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false); However I get the following error: Error 1 Using the generic type 'Microsoft.AspNet.Identity.Owin.SignInManager<TUser,TKey>' requires 2 type arguments Before this I had to install a few nuget packages so I think something merely has been missed somewhere, but this is way out my my league! Any help would be hugely

Identity cookie expiry

和自甴很熟 提交于 2020-01-06 18:05:13
问题 How would I redirect to login page AUTOMATICALLY, if my Identity cookie has expired at "ExpireTimeSpan" value? I do understand there is an event "OnRedirectToLogin" but that doesn't get triggered unless a request comes through. Is there a way, I can redirect to login right after the cookie has expired rather than keep sending requests to verify it has timed out? 回答1: Unless I misunderstand, what you want is the server to reach out to the client, but standard client/server HTTP works the other

ASP.NET Identity's way of hashing password Compared to Crypto.HashPassword

混江龙づ霸主 提交于 2020-01-06 14:33:38
问题 Good Day everyone. I'm currently creating a Login Form in Xamarin.Forms Portable application. I have a WebFormsProject, wherein I created an API controller that compares the username and password typed by the User versus the username and password saved on my Database. The password saved on my database is Hashed using ASP.NET Identity. While the password that will be typed by the User is hashed using Crypto.HashPassword (don't know if this class is an ASP.NET Identity thing). How can I compare

ASP.NET Identity's way of hashing password Compared to Crypto.HashPassword

青春壹個敷衍的年華 提交于 2020-01-06 14:33:29
问题 Good Day everyone. I'm currently creating a Login Form in Xamarin.Forms Portable application. I have a WebFormsProject, wherein I created an API controller that compares the username and password typed by the User versus the username and password saved on my Database. The password saved on my database is Hashed using ASP.NET Identity. While the password that will be typed by the User is hashed using Crypto.HashPassword (don't know if this class is an ASP.NET Identity thing). How can I compare

Registration method with Identity on an empty project

▼魔方 西西 提交于 2020-01-06 14:04:42
问题 I'm working in an empty MVC entity framework with ASP.NET Identity project , trying to finish a Register method for an IdentityController that handle all user related operations. The problem is that when trying to login with SignInAsync method after creating the user, the system doesn't find the references to work with that method. So, on the following code snippet...: using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System; using System.Collections