asp.net-core-identity

Problem running project after Identity scaffolding in ASP.NET Core MVC project on Linux

穿精又带淫゛_ 提交于 2020-02-28 07:50:25
问题 I've tried adding <PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" /> However 2.2.0 is the latest version available at this time, which doesn't match the error. The error is still the same after rebuilding the app. project.csproj: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <RuntimeIdentifier>linux-x64</RuntimeIdentifier> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore

Problem running project after Identity scaffolding in ASP.NET Core MVC project on Linux

蓝咒 提交于 2020-02-28 07:48:30
问题 I've tried adding <PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" /> However 2.2.0 is the latest version available at this time, which doesn't match the error. The error is still the same after rebuilding the app. project.csproj: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <RuntimeIdentifier>linux-x64</RuntimeIdentifier> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore

Allow supporter to sign in as another user

你说的曾经没有我的故事 提交于 2020-01-30 06:32:07
问题 We currently have an Identity server 4 application. Using entity framework core and asp .net identity. We have a group of supporters who need to be able to access our users accounts in order to help them with issues over the phone. Our users are not able to figure out how to use team viewer. As most of them are mobile and will only have a cellphone at the time. I know all the security ramifications of allowing other people to sign into your account however there is really no way around this.

Core 3.0 ApplicationUser is always empty

耗尽温柔 提交于 2020-01-25 08:26:27
问题 I have extended Identityuser public class ApplicationUser : IdentityUser { [MaxLength(150)] public string FirstName { get ; set ; } [MaxLength(150)] public string LastName { get ; set ; } public int AlternateUserId { get ; set ; } [MaxLength(150)] public string CompanyName { get ; set ; } [MaxLength(38)] [Required] public string ClientId { get ; set ; } [Required] public int ShortClient { set ; get ; } public bool Locked { set ; get ; } } In Startup.cs i have: services.AddIdentity

Cookie not expiring per StartUp.cs settings

早过忘川 提交于 2020-01-25 07:26:10
问题 I have tried a plethora of solutions over the course of 2 days and still have not been able to get this to work. What I want is for a user cookie to expire after a set amount of time E.g. User A logs in and goes to home page, User A goes for a lunch break. User A comes back and clicks on the nav bar and gets redirected to the login page. I have tried everything from AddAuthentication() , AddSession() and AddCookie() options all having an ExpireTimeSpan and Cookie.Expiration of my choosing.

ASP.Net Core 2.2 SignInManager 'No sign-in authentication handler is registered for the scheme 'Identity.Application'

不问归期 提交于 2020-01-24 06:37:22
问题 I have the following configurations in Startup.cs: services.AddAuthentication(options => { options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; //options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme; }).AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, o => { o.LoginPath = Routes.Urls.AdminAccountLogin; o.AccessDeniedPath = Routes.Urls.AdminAccountAccessdenied; }).AddJwtBearer(configureOptions => {}); The application throws the

Testing user if he has a specific authority using AuthorizeAsync() in Xunit-Unit Testing

烂漫一生 提交于 2020-01-21 08:46:27
问题 The question has been Updated for better explanation to the issue I have, Simply I have this controller, [Authorize] public class IdeaManagementController : Controller { private IIdeaManagementService _ideaManagementService; private ITenantService _tenantService; private ITagService _tagService; private IEmployeeIdeaCategoryService _ideaManagementCategoryService; private static PbdModule _modul = PbdModule.IdeaManagement; IAuthorizationService _authorizationService; public

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

Social authentication in Web Api Core

那年仲夏 提交于 2020-01-04 04:39:09
问题 ASP.NET Core has integrated support for Google, Facebook and Twitter authentication. This msdn article covers it pretty well. But it seems like it works only for MVC but for Web Api you have to implement a lot of stuff on your own. Thanks to Openiddict I managed to do it for my project but it still feels like I have to write quite low-level code that should be a part of framework. It would be nice to have simple calls like app.UseGoogleAuthentication in Web Api . So my question is why they

File Path for PersistKeysToFileSystem on shared server

南楼画角 提交于 2020-01-04 04:08:07
问题 I'm trying to make my keys persist for users that log in. As I'm currently using shared hosting for the website, I've decided to use the file system to store the keyring. So the code looks like this: services.AddDataProtection() .PersistKeysToFileSystem(new DirectoryInfo("")) .SetApplicationName("MyWebsite") .SetDefaultKeyLifetime(TimeSpan.FromDays(90)) .ProtectKeysWithCertificate(cert); However, what I'm not really understanding is where I should hold these keys, and what would be the path I