asp.net-identity

How to Logout user from a particular session Identity Server 4, .Net Core?

烈酒焚心 提交于 2020-08-27 08:57:12
问题 Using Identity Serve 4 with .Net Core 3.1, razor pages. Also using Cookie Authentication services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) Problem - In a web application John logged-in 2 times 1st Login on Chrome 2nd Login on edge So, if John again trying to logged-in on 3rd time on Firefox without logout from previous browsers, then I want to logout John from 1st Login on Chrome forcefully. I can keep the track of logins in a Session table including Session Id,

ASP.NET Core - Scaffold Identity like MVC

↘锁芯ラ 提交于 2020-08-24 06:01:19
问题 I have created a Web Application MVC project with Individuals User Accounts authentication. Afterwards I created a custom UserIdentity. I am trying to change the default "Register" view of Identity adding my new fields, however I only managed to scaffold new pages as Razor Pages. My question is: Is it possible to scaffold these new views in some structure like MVC? I would not like to mix MVC with Razor Pages at all. If this is not possible, is there any way to creating a controller that

Unable to resolve service for type IEmailSender while attempting to activate RegisterModel

核能气质少年 提交于 2020-08-22 04:12:51
问题 I'm using Identity and I have a problem that I make a new example project and with individual authentication and scaffold identity InvalidOperationException: Unable to resolve service for type 'Microsoft.AspNetCore.Identity.UI.Services.IEmailSender' while attempting to activate 'MASQ.Areas.Identity.Pages.Account.RegisterModel'. 回答1: There're two ways to do that : remove the services.AddDefaultTokenProviders() in the ConfigurureServices() to disable two-factor authentication (2FA) : // file: